Re: [ansible-project] Re: Parsing results

2020-05-29 Thread Andrew Morgan
That you very much this code below worked. - name: setting fact for subnet ID set_fact: SUBNETID="{{ item.subnet_id }}" with_items: "{{ ec2_facts.instances[0].network_interfaces }}" - name: setting fact for Security group set_fact: SERCURITYGROUP="{{ item.group_name }}"

Re: [ansible-project] Re: Parsing results

2020-05-28 Thread Dick Visser
On Thu, 28 May 2020 at 16:28, Andrew Morgan wrote: > And yes, the name network_instances is correct > > https://docs.ansible.com/ansible/latest/modules/ec2_instance_info_module.html I don't see any mention of that name? Typo? Either way, IIRC ec2_facts.instances is a list, so you'd have to

Re: [ansible-project] Re: Parsing results

2020-05-28 Thread Andrew Morgan
Thank you for you assistance , but I am not successful , I am getting the below error. TASK [setting fact for subnet ID] ** fatal: [deVPN]: FAILED! => * msg: '''list object'' has no attribute

Re: [ansible-project] Re: Parsing results

2020-05-26 Thread Vladimir Botka
On Tue, 26 May 2020 16:47:22 -0700 (PDT) ChrisV wrote: > `network_interfaces` is a list. You will need to include the index of the > interface, which is 0 in your example. > > Ex. "{{ ec2_facts.instances.network_interfaces[0] }}" The loop below would work in this case. > > - name: setting

[ansible-project] Re: Parsing results

2020-05-26 Thread ChrisV
`network_interfaces` is a list. You will need to include the index of the interface, which is 0 in your example. Ex. "{{ ec2_facts.instances.network_interfaces[0] }}" ChrisV On Monday, May 25, 2020 at 5:20:35 PM UTC-7, Andrew Morgan wrote: > > Hello All, > > I have a script below that will

[ansible-project] Re: Parsing results

2020-05-26 Thread Andrew Morgan
thank you this is a good suggestion, however is beyond the scope of my project at the moment. So unluckily I will have to try and parse the variables.Anyone can assist? On Monday, 25 May 2020 20:20:35 UTC-4, Andrew Morgan wrote: > > Hello All, > > I have a script below that will get the