You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On ansible 1.9.4 I'm seeing the following bug (which isn't present in 2.1.x)
We ran into the following issue today: Running an 'assemble' task in a handler from an ansible-playbook in 'check' mode will result in overwriting the destination file:
mark@shell:/tmp/ansibletest$ echo "original destinationfile" > dest/destfile
mark@shell:/tmp/ansibletest$ cat dest/destfile
original destinationfile
mark@shell:/tmp/ansibletest$ echo "source-file1" > source/file1
mark@shell:/tmp/ansibletest$ echo "source-file2" > source/file2
mark@shell:/tmp/ansibletest$ ls -al source/ dest/
dest/:
total 12
drwxr-xr-x 2 mark maniac 4096 Jan 28 11:21 .
drwxr-xr-x 5 mark maniac 4096 Jan 28 11:21 ..
-rw------- 1 mark maniac 25 Jan 28 11:26 destfile
source/:
total 16
drwxr-xr-x 2 mark maniac 4096 Jan 28 11:21 .
drwxr-xr-x 5 mark maniac 4096 Jan 28 11:21 ..
-rw-r--r-- 1 mark maniac 13 Jan 28 11:26 file1
-rw-r--r-- 1 mark maniac 13 Jan 28 11:26 file2
mark@shell:/tmp/ansibletest$ ansible-playbook -i hosts plays/test.yml --check
PLAY [localhost] **************************************************************
Thanks for testing this against devel as well (and glad to see we've resolved it there). Holding this open for review as a possible inclusion in a future 1.9.x release.
On ansible 1.9.4 I'm seeing the following bug (which isn't present in 2.1.x)
We ran into the following issue today: Running an 'assemble' task in a handler from an ansible-playbook in 'check' mode will result in overwriting the destination file:
mark@shell:/tmp/ansibletest$ echo "original destinationfile" > dest/destfile
mark@shell:/tmp/ansibletest$ cat dest/destfile
original destinationfile
mark@shell:/tmp/ansibletest$ echo "source-file1" > source/file1
mark@shell:/tmp/ansibletest$ echo "source-file2" > source/file2
mark@shell:/tmp/ansibletest$ ls -al source/ dest/
dest/:
total 12
drwxr-xr-x 2 mark maniac 4096 Jan 28 11:21 .
drwxr-xr-x 5 mark maniac 4096 Jan 28 11:21 ..
-rw------- 1 mark maniac 25 Jan 28 11:26 destfile
source/:
total 16
drwxr-xr-x 2 mark maniac 4096 Jan 28 11:21 .
drwxr-xr-x 5 mark maniac 4096 Jan 28 11:21 ..
-rw-r--r-- 1 mark maniac 13 Jan 28 11:26 file1
-rw-r--r-- 1 mark maniac 13 Jan 28 11:26 file2
mark@shell:/tmp/ansibletest$ ansible-playbook -i hosts plays/test.yml --check
PLAY [localhost] **************************************************************
TASK: [test] ******************************************************************
changed: [localhost]
NOTIFIED: [assembletest] ******************************************************
changed: [localhost]
PLAY RECAP ********************************************************************
localhost : ok=2 changed=2 unreachable=0 failed=0
mark@shell:/tmp/ansibletest$ cat dest/destfile
source-file1
source-file2
mark@shell:/tmp/ansibletest$
The playbook used:
hosts: localhost
connection: local
gather_facts: no
vars:
sudo: no
tasks:
command: /bin/true
notify: assembletest
always_run: yes
handlers:
assemble: dest=/tmp/ansibletest/dest/destfile src=/tmp/ansibletest/source/
Running the same on ansible 2.1.0 (current devel) doesn't do this, as it skips running the handler
PLAY ***************************************************************************
TASK [test] ********************************************************************
changed: [localhost]
RUNNING HANDLER [assembletest] *************************************************
skipping: [localhost]
PLAY RECAP *********************************************************************
localhost : ok=1 changed=1 unreachable=0 failed=0
The text was updated successfully, but these errors were encountered: