Created
August 2, 2018 10:45
-
-
Save fridim/ebbbc86bb732f262f4239179acb2b8b3 to your computer and use it in GitHub Desktop.
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
PLAY [localhost] ****************************************************************************************************************************************************************************** | |
TASK [set_fact] ******************************************************************************************************************************************************************************* | |
ok: [localhost] | |
TASK [include_role : /tmp/testrole] *********************************************************************************************************************************************************** | |
TASK [/tmp/testrole : set_fact] *************************************************************************************************************************************************************** | |
skipping: [localhost] | |
TASK [/tmp/testrole : debug] ****************************************************************************************************************************************************************** | |
ok: [localhost] => { | |
"msg": "loop number 1. stop == False" | |
} | |
TASK [/tmp/testrole : set_fact] *************************************************************************************************************************************************************** | |
ok: [localhost] | |
TASK [/tmp/testrole : debug] ****************************************************************************************************************************************************************** | |
ok: [localhost] => { | |
"msg": "loop number 2. stop == True" | |
} | |
TASK [/tmp/testrole : set_fact] *************************************************************************************************************************************************************** | |
skipping: [localhost] | |
TASK [/tmp/testrole : debug] ****************************************************************************************************************************************************************** | |
ok: [localhost] => { | |
"msg": "loop number 3. stop == True" | |
} | |
TASK [/tmp/testrole : set_fact] *************************************************************************************************************************************************************** | |
skipping: [localhost] | |
TASK [/tmp/testrole : debug] ****************************************************************************************************************************************************************** | |
ok: [localhost] => { | |
"msg": "loop number 4. stop == True" | |
} | |
TASK [/tmp/testrole : set_fact] *************************************************************************************************************************************************************** | |
skipping: [localhost] | |
TASK [/tmp/testrole : debug] ****************************************************************************************************************************************************************** | |
ok: [localhost] => { | |
"msg": "loop number 5. stop == True" | |
} | |
PLAY RECAP ************************************************************************************************************************************************************************************ | |
localhost : ok=7 changed=0 unreachable=0 failed=0 | |
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 | |
connection: local | |
gather_facts: no | |
tasks: | |
- set_fact: | |
stop: false | |
- name: test loop | |
with_items: | |
- 1 | |
- 2 | |
- 3 | |
- 4 | |
- 5 | |
vars: | |
index: "{{ item }}" | |
include_role: | |
name: "/tmp/testrole" | |
when: not stop | |
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
--- | |
- set_fact: | |
stop: true | |
when: index == '2' or index == 2 | |
- debug: | |
msg: "loop number {{index}}. stop == {{stop}}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment