Created
May 28, 2021 11:54
-
-
Save cuyk/175a2234f4ca5efdcc9bcc16061d2739 to your computer and use it in GitHub Desktop.
ansible loop break
This file contains 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
--- | |
- hosts: localhost | |
tasks: | |
- file: | |
path: '{{ item }}' | |
state: directory | |
register: res | |
when: not (res.changed|d(false)) | |
loop: '{{ list_of_items }}' | |
vars: | |
list_of_items: | |
- /etc | |
- /bin | |
- example1 | |
- example2 | |
- example3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment