diff options
author | Michael Scherer <misc@zarb.org> | 2014-12-16 00:36:05 +0100 |
---|---|---|
committer | Michael Scherer <misc@zarb.org> | 2014-12-16 00:36:05 +0100 |
commit | 530fae32e00ead64d695d6e1db8525a78946a620 (patch) | |
tree | b19bb8aad71a4e386f5fbd78032f7e1e4d76a73f | |
parent | 295779c70c08ec3e6810064a012574b93c8bda50 (diff) |
Split creation and erasure in 2 differents actions
This permit to reduce the number of "changed" in the output
and unneed churn. Could be factored in 1 action if
my PR is accepted.
-rw-r--r-- | roles/git_repositories/tasks/main.yml | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/roles/git_repositories/tasks/main.yml b/roles/git_repositories/tasks/main.yml index 112e372..21f7513 100644 --- a/roles/git_repositories/tasks/main.yml +++ b/roles/git_repositories/tasks/main.yml @@ -22,9 +22,17 @@ - shell: creates={{ git_repositories_dir }}/{{ item.name }}/config chdir={{ git_repositories_dir }}/{{ item.name }} git init --bare -q --shared=group with_items: git_repositories +# refactor this one and the next if https://github.com/ansible/ansible-modules-core/pull/520 is merged - file: path: "{{ git_repositories_dir }}/{{ item.name }}/git-daemon-export-ok" - state: "{% if item.private is defined and item.private %}absent{% else %}touch{% endif %}" + state: absent + when: item.private is defined and item.private + with_items: git_repositories + +- copy: + dest: "{{ git_repositories_dir }}/{{ item.name }}/git-daemon-export-ok" + content: "" + when: item.private is not defined or not item.private with_items: git_repositories - copy: |