Are there any function to find duplication of file transfer destination in "copy" and "template" tasks

9 views
Skip to first unread message

Masaru Dobashi

unread,
Sep 9, 2014, 4:51:36 AM9/9/14
to ansible...@googlegroups.com
Hi all,

I'm using Ansible for configuration management.
Does Ansible have any function to detect overlaping of file modification in "copy" / "template" tasks?

I want to get some messages or warnings to know overlaping in the following situation.

Example
--------------
The main playbook uses role1 and role2 like the following::

 site.yml
 roles/role1/tasks/main.yml ... (1)
 roles/role2/tasks/main.yml ... (2)

Role1 and role2 is used in the playbook.

And, if the same file is modified twice by both of role1 and role2,
I want to know this situation from any information.

Example of site.yml::

 - hosts: server
   roles:
     - role1
     - role2

Example of main.yml (1)::

 -name: role1
  copy: src=tmp_role1.conf dest=/tmp/tmp.conf

Example of main.yml (2)::

 - name: role2
   copy: src=tmp_roles2.conf dest=/tmp/tmp.conf

In the above examples, /tmp/tmp.conf is modified twice.

Thanks,
Masaru
Reply all
Reply to author
Forward
0 new messages