Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save zeitounator/69a6ab46d237ebda57f1e8baeee0a2ec to your computer and use it in GitHub Desktop.
Save zeitounator/69a6ab46d237ebda57f1e8baeee0a2ec to your computer and use it in GitHub Desktop.
$ cat test.yml
- hosts: localhost
gather_facts: false
tasks:
- name: Test task
ansible.builtin.debug:
msg: This task runs
loop: [1,2,3,4]
when: item < 3
$ ansible-playbook test.yml
PLAY [localhost] **************************************************************************************************************************************************************************************************
TASK [Test task] **************************************************************************************************************************************************************************************************
ok: [localhost] => (item=1) => {
"msg": "This task runs"
}
ok: [localhost] => (item=2) => {
"msg": "This task runs"
}
skipping: [localhost] => (item=3)
skipping: [localhost] => (item=4)
PLAY RECAP ********************************************************************************************************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment