Created
October 30, 2019 19:11
-
-
Save txomon/76701430151361ff7fa460ddb109a0ab to your computer and use it in GitHub Desktop.
Example declarative metamodule for ansible
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
- name: Make sure only three files exist in /myfolder | |
declarative: | |
items: | |
- a | |
- b | |
- c | |
state: | |
command: find /myfolder/ | tail -n +2 | basename | |
extra_item: | |
file: | |
path: /myfolder/{{ item }} | |
state: absent | |
missing_item: | |
file: | |
path: /myfolder/{{ item }} | |
state: touch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment