So while it's indeed a list by default, as you posted "A simple string is still accepted and works as a single pattern."
Based on that I highly doubt that issue is indeed related to the list vs string for setup. I wrote a simple playbook to verify that current way of setup is not broken. I also tested with ansible 2.12.2 and result was exactly the same.
Output:
root@server-0207-1334:~/openstack-ansible# openstack-ansible test.yml
Variable files: "-e @/etc/openstack_deploy/user_ceph_aio.yml -e @/etc/openstack_deploy/user_secrets.yml -e @/etc/openstack_deploy/user_variables.yml -e @/etc/openstack_deploy/user_variables_barbican.yml -e @/etc/openstack_deploy/user_variables_ceph.yml "
[WARNING]: Unable to parse /etc/openstack_deploy/inventory.ini as an inventory source
Operations to perform:
Apply all migrations: admin, api, auth, contenttypes, db, sessions
Running migrations:
No migrations to apply.
PLAY [aio1] *******************************************************************************************************************************************************************************************************************************************************************
2022-02-07 19:43:47,625 INFO ansible: PLAY [aio1] *******************************************************************************************************************************************************************************************************************************************************************
TASK [Clean facts] ************************************************************************************************************************************************************************************************************************************************************
2022-02-07 19:43:47,898 INFO ansible: TASK [Clean facts] ************************************************************************************************************************************************************************************************************************************************************
ok: [aio1] => {
"ansible_all_ipv4_addresses": "VARIABLE IS NOT DEFINED!"
}
2022-02-07 19:43:47,954 INFO ansible: ok: [aio1] => {
"ansible_all_ipv4_addresses": "VARIABLE IS NOT DEFINED!"
}
So while it's indeed a list by default, as you posted "A simple string is still accepted and works as a single pattern."
Based on that I highly doubt that issue is indeed related to the list vs string for setup. I wrote a simple playbook to verify that current way of setup is not broken. I also tested with ansible 2.12.2 and result was exactly the same.
Output:
root@server- 0207-1334: ~/openstack- ansible# openstack-ansible test.yml _deploy/ user_ceph_ aio.yml -e @/etc/openstack _deploy/ user_secrets. yml -e @/etc/openstack _deploy/ user_variables. yml -e @/etc/openstack _deploy/ user_variables_ barbican. yml -e @/etc/openstack _deploy/ user_variables_ ceph.yml " deploy/ inventory. ini as an inventory source
Variable files: "-e @/etc/openstack
[WARNING]: Unable to parse /etc/openstack_
Operations to perform:
Apply all migrations: admin, api, auth, contenttypes, db, sessions
Running migrations:
No migrations to apply.
PLAY [aio1] ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* *******
2022-02-07 19:43:47,625 INFO ansible: PLAY [aio1] *******
TASK [Clean facts] ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* all_ipv4_ addresses" : "VARIABLE IS NOT DEFINED!" all_ipv4_ addresses" : "VARIABLE IS NOT DEFINED!"
2022-02-07 19:43:47,898 INFO ansible: TASK [Clean facts] *******
ok: [aio1] => {
"ansible_
}
2022-02-07 19:43:47,954 INFO ansible: ok: [aio1] => {
"ansible_
}
TASK [Gather additional facts] ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ** ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* **
2022-02-07 19:43:48,081 INFO ansible: TASK [Gather additional facts] *******
ok: [aio1]
2022-02-07 19:43:50,153 INFO ansible: ok: [aio1]
TASK [Gathered facts after setup] ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ****** ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ****** all_ipv4_ addresses" : [
"172.29. 236.100" ,
"172.29. 236.101" ,
"172.29. 228.100" ,
"172.17. 0.1",
"172.29. 240.100" ,
"172.29. 252.100" ,
"172.29. 232.100" ,
"172.29. 248.1",
"172.29. 248.100" ,
"10.1. 0.184",
"172.29. 244.100" all_ipv4_ addresses" : [
"172.29. 236.100" ,
"172.29. 236.101" ,
"172.29. 228.100" ,
"172.17. 0.1",
"172.29. 240.100" ,
"172.29. 252.100" ,
"172.29. 232.100" ,
"172.29. 248.1",
"172.29. 248.100" ,
"10.1. 0.184",
"172.29. 244.100"
2022-02-07 19:43:50,295 INFO ansible: TASK [Gathered facts after setup] *******
ok: [aio1] => {
"ansible_
]
}
2022-02-07 19:43:50,427 INFO ansible: ok: [aio1] => {
"ansible_
]
}
PLAY RECAP ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* * ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* ******* *
2022-02-07 19:43:50,515 INFO ansible: PLAY RECAP *******
aio1 : ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
2022-02-07 19:43:50,515 INFO ansible: aio1 : ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
EXIT NOTICE [Playbook execution success] ******* ******* ******* ******* ******* *** ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= == 0207-1334: ~/openstack- ansible# ansible --version _deploy/ user_ceph_ aio.yml -e @/etc/openstack _deploy/ user_secrets. yml -e @/etc/openstack _deploy/ user_variables. yml -e @/etc/openstack _deploy/ user_variables_ barbican. yml -e @/etc/openstack _deploy/ user_variables_ ceph.yml " ansible/ roles/ceph- ansible/ library' ] runtime/ lib/python3. 8/site- packages/ ansible runtime/ bin/ansible 0207-1334: ~/openstack- ansible# 0207-1334: ~/openstack- ansible# cat test.yml
=======
root@server-
Variable files: "-e @/etc/openstack
ansible [core 2.11.6]
config file = None
configured module search path = ['/etc/
ansible python module location = /opt/ansible-
ansible collection location = /etc/ansible
executable location = /opt/ansible-
python version = 3.8.10 (default, Nov 26 2021, 20:14:08) [GCC 9.3.0]
jinja version = 3.0.3
libyaml = True
root@server-
root@server-
- hosts: aio1
gather_facts: false
tasks:
- name: Clean facts all_ipv4_ addresses
debug:
var: ansible_
- name: Gather additional facts
gather_ subset: "!all,network" all_ipv[ 4|6]_addresses"
setup:
filter: "ansible_
- name: Gathered facts after setup all_ipv4_ addresses 0207-1334: ~/openstack- ansible#
debug:
var: ansible_
root@server-