Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 'only_transfers_as_changes' option to synchronize module #57885

Open
wants to merge 3 commits into
base: devel
from

Conversation

Projects
None yet
4 participants
@RustyDust
Copy link

commented Jun 15, 2019

SUMMARY

This change adds a new option 'only_transfers_as_changes' to the synchronize module.

Rationale
When managing configurations to be deployed with ansible in git the time stamps of the files aren't preserved. When working with a distributed team this means time stamps of config files are always local to the member's computers. This together with the usage of the synchronize module often results in ansible detecting changes where there actually aren't any and in consequence unnecessary restarts of services at deploy time - often services the person wasn't even working on.

This PR adds a new boolean option 'only_transfers_as_changes' to the synchronize module that does the following:

  • enforces the 'checksum' mode on rsync
  • sets the 'changed' flag with in the module solely depending on real transfers TO the destination (as indicated by the '<' flag in rsync's response)

While setting the 'checksum' option may have an impact on synchronize's performance this should be negligible considering the main use would be for relatively small text files.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

sychronize

ADDITIONAL INFORMATION

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2019

The test ansible-test sanity --test ansible-doc --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:0:0: missing documentation (or could not parse documentation): expected string or buffer

The test ansible-test sanity --test ansible-doc --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:0:0: missing documentation (or could not parse documentation): expected string or buffer

The test ansible-test sanity --test ansible-doc --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

The test ansible-test sanity --test ansible-doc --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

The test ansible-test sanity --test ansible-doc --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

The test ansible-test sanity --test ansible-doc --python 3.8 [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:0:0: missing documentation (or could not parse documentation): expected string or bytes-like object

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:458:7: E111 indentation is not a multiple of four

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

lib/ansible/modules/files/synchronize.py:0:0: E305 DOCUMENTATION.options.only_transfers_as_changes.description.1: expected str @ data['options']['only_transfers_as_changes']['description'][1]. Got {'sets "checksum': 'yes"'}
lib/ansible/modules/files/synchronize.py:0:0: E309 version_added for new option (only_transfers_as_changes) should be '2.9'. Currently StrictVersion ('0.0')
lib/ansible/modules/files/synchronize.py:0:0: E325 Argument 'only_transfers_as_changes' in argument_spec defines type as <class 'bool'> but documentation defines type as 'bool'

click here for bot help

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2019

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:457:7: E111 indentation is not a multiple of four

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/files/synchronize.py:0:0: E309 version_added for new option (only_transfers_as_changes) should be '2.9'. Currently StrictVersion ('0.0')

click here for bot help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.