--
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 ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgroups.google.com%2Fd%2Fmsgid%2Fansible-project%2FCABOsP2N_wX5OuviQeXHzhTV%252BfGq%252BsOgHguTzy%253D%253Dh8v%253D5erx%252BHg%2540mail.gmail.com&data=05%7C01%7Cwalter.rowe%40nist.gov%7C11c761941c2b4b87c06e08db3f923bbe%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C638173669526803891%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=F6cPYHsoFbMUJ8lWJKDuG2ym1o5eZLCrPId0qytWK3Y%3D&reserved=0.
--
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 ansible-proje...@googlegroups.com.
% cat foo.yml
---
- name: test lists
become: false
gather_facts: false
hosts: localhost
vars:
lista:
- { one: 'str1', two: 'str2' }
listb:
- { three: 'str3', four: 'str4' }
tasks:
- debug: var=lista
- debug: var=listb
- set_fact:
listb: [ "{{ lista + listb }}" ]
- debug: var=listb
% ansible-playbook foo.yml
PLAY [test lists] ******************************************************************************************************
TASK [debug] ***********************************************************************************************************
ok: [localhost] => {
"lista": [
{
"one": "str1",
"two": "str2"
}
]
}
TASK [debug] ***********************************************************************************************************
ok: [localhost] => {
"listb": [
{
"four": "str4",
"three": "str3"
}
]
}
TASK [set_fact] ********************************************************************************************************
ok: [localhost]
TASK [debug] ***********************************************************************************************************
ok: [localhost] => {
"listb": [
[
{
"one": "str1",
"two": "str2"
},
{
"four": "str4",
"three": "str3"
}
]
]
}
PLAY RECAP *************************************************************************************************************
localhost : ok=4 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
On Apr 18, 2023, at 9:07 AM, Michael DiDomenico <mdidom...@gmail.com> wrote:
--
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 ansible-proje...@googlegroups.com.
[utoddl@tango ansible]$ cat foo.yml --- - name: test lists become: false gather_facts: false hosts: localhost vars: list_12: - { one: 'str1', two: 'str2' } list_34: - { three: 'str3', four: 'str4' } list_56: - { five: 'str5', six: 'str6' } tasks: - debug: msg="[ {{ list_12, list_34, list_56 }} ]" - debug: msg="{{ [list_12, list_34, list_56] | sum(start=[]) }}" [utoddl@tango ansible]$ ansible-playbook foo.yml PLAY [test lists] *************************************************************** TASK [debug] ******************************************************************** ok: [localhost] => { "msg": [ [ [ { "one": "str1", "two": "str2" } ], [ { "four": "str4", "three": "str3" } ], [ { "five": "str5", "six": "str6" } ] ] ] } TASK [debug] ******************************************************************** ok: [localhost] => { "msg": [ { "one": "str1", "two": "str2" }, { "four": "str4", "three": "str3" }, { "five": "str5", "six": "str6" } ] } PLAY RECAP ********************************************************************** localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6C71BFC3-34D5-4E2A-90E9-1CDB56B3CCE6%40nist.gov.
-- Todd
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/4ab442a2-1b5a-5565-fc26-07994cb80dfd%40gmail.com.
--
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 ansible-proje...@googlegroups.com.
--
Todd
--
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 ansible-proje...@googlegroups.com.
--
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 ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/FC476FE3-4A0D-4868-9B25-BC5237FD0386%40nist.gov.