diff options
author | Aleks <git001@users.noreply.github.com> | 2018-05-25 19:49:46 +0200 |
---|---|---|
committer | Adam Miller <admiller@redhat.com> | 2018-05-25 12:49:46 -0500 |
commit | bc2430694c152311eb7768227ab9ce54a1c99715 (patch) | |
tree | ae6a6c99d792b91d2fca8df8473f66154e4427e6 | |
parent | 8746d9ef87a9524c3c6d1640d5953aa1f2ae1285 (diff) | |
download | ansible-bc2430694c152311eb7768227ab9ce54a1c99715.tar.gz |
Add a note for multible changes in one file (#37090)
As mentioned in this answer https://stackoverflow.com/a/41549694/6778826 we was able to solve a bad behaviour of `blockinfile` module.
We must change two parts in one file which we have done in two tasks. Every run have rewriten the first block with the second block in the wrong position. **After** we have set the `marker` in the second task to another value was the `blockinfile` module able to insert both parts in the right position in the same file.
-rw-r--r-- | lib/ansible/modules/files/blockinfile.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ansible/modules/files/blockinfile.py b/lib/ansible/modules/files/blockinfile.py index 16b2b741e4..4022a8df49 100644 --- a/lib/ansible/modules/files/blockinfile.py +++ b/lib/ansible/modules/files/blockinfile.py @@ -95,6 +95,7 @@ notes: - When using 'with_*' loops be aware that if you do not set a unique mark the block will be overwritten on each iteration. - As of Ansible 2.3, the I(dest) option has been changed to I(path) as default, but I(dest) still works as well. - Option I(follow) has been removed in version 2.5, because this module modifies the contents of the file so I(follow=no) doesn't make sense. + - When more then one block should be handled in **one** file you **must** change the I(marker) per task """ EXAMPLES = r""" |