Re: [ansible-project] Re: ec2 creation vs ec2 retreival: different value of registered variable

8 views
Skip to first unread message
Message has been deleted
Message has been deleted

David Villasmil

unread,
May 27, 2018, 5:58:26 AM5/27/18
to ansible...@googlegroups.com

Remove all formatting please


On Sun, May 27, 2018, 11:28 <ali.k...@aurea.com> wrote:
what i have realized is that on ec2 retrieval, the output is a json object, whereas on ec2 creation, the output is json but in a string format.  is this understanding correct?  do i need to convert the output to json when ec2 instance is created to retrieve the values?


On Sunday, May 27, 2018 at 12:02:21 PM UTC+3, ali.k...@aurea.com wrote:
i have a script in which sometimes i need to create an ec2 instance and sometimes an existing ec2 instance is retrieved.  on both occasions, i do some further processing on the output like the following:

  - name: add hosts to group
    add_host:
        name: "{{ item.id }}"
        ansible_host: "{{ item.private_ip }}"
        group: windows
    with_items: "{{ ec2_result.instances }}"

the above works when i am retrieving an existing ec2 instance, but does not work when i am create a new one.  can someone clarify what i am doing wrong? or what the issue is?

--
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 post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/c700ad35-9c76-423a-8365-dbd13356d97b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ali.k...@aurea.com

unread,
May 27, 2018, 6:12:52 AM5/27/18
to Ansible Project
i'll start a new thread.  there isn't seems to be an option to modify an existing post.
Reply all
Reply to author
Forward
0 new messages