Last active
April 7, 2017 12:16
-
-
Save thomaslorentsen/d0d689f7877df3a89a098641654145c0 to your computer and use it in GitHub Desktop.
Only install unzip if directories do not exist
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- block: | |
- name: test files exist | |
stat: | |
path: "{{ item }}" | |
register: directory_exists | |
changed_when: directory_exists.stat.exists == false | |
with_items: "{{ target_directories }}" | |
- name: install unzip | |
package: | |
name: unzip | |
state: present | |
when: directory_exists.changed | |
- debug: msg="unzip will be removed at the end of play" | |
notify: remove unzip | |
changed_when: directory_exists.changed | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
dependencies: | |
- unzip: | |
role: common/unzip | |
target_directories: | |
- "/usr/java/{{ java.server_dir }}" | |
- "/usr/java/{{ java.server_dir }}/jre/lib/security" | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment