Skip to content

Instantly share code, notes, and snippets.

@fridim fridim/output.txt
Created Aug 2, 2018

Embed
What would you like to do?
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
- 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
---
- 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
You can’t perform that action at this time.