Hey all - I think I'm losing my mind. Can anyone explain why every
iteration of task 3 is being skipped (compare w/ task 2, especially)?
(ansible2_12_8) rowagn@mlb656 client % cat d.yml
- hosts: all
gather_facts: no
vars:
s: '1 2 3'
t: p1_xyz
t_list:
- p1_xyz
- p2_xyz
tasks:
- name: task 1
debug:
msg: '{{ ( t | regex_replace("^p(\d+).*$", "\1") ) in s }}'
- name: task 2
debug:
msg: '{{ ( item | regex_replace("^p(\d+).*$", "\1") ) in s }}'
loop: "{{ t_list }}"
- name: task 3
debug:
msg: "{{ item }} is in s"
loop: "{{ t_list }}"
when: ( item | regex_replace("^p(\d+).*$", "\1") ) in s
(ansible2_12_8) rowagn@mlb656 client % ansible-playbook d.yml -i ~/localhost
PLAY [all]
**********************************************************************************************************
TASK [task 1]
*******************************************************************************************************
ok: [localhost] => {
"msg": true
}
TASK [task 2]
*******************************************************************************************************
ok: [localhost] => (item=p1_xyz) => {
"msg": true
}
ok: [localhost] => (item=p2_xyz) => {
"msg": true
}
TASK [task 3]
*******************************************************************************************************
skipping: [localhost] => (item=p1_xyz)
skipping: [localhost] => (item=p2_xyz)
skipping: [localhost]
PLAY RECAP
**********************************************************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0
skipped=1 rescued=0 ignored=0
I've started at this for hours.
Rob
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/88a55b8c-718d-4a61-88c3-bf989525e65cn%40googlegroups.com.