Hi Coach, you might want to start a new thread for a new question about something completely different. Re-using the old thread might cause people who could otherwise help you ignore your question because they think it is about the old topic. Also, the people who answered to the old thread earlier might now know enough to answer your new question. That's the case for me and your new question, as I've never used the ec2 module.
Cheers, Felix On Mon, 20 Aug 2018 21:24:16 +0530 coach rhca <[email protected]> wrote: > any valuable inputs from you experts ..not sure if calling it the > right way after register the variable.. > > On Mon, Aug 20, 2018 at 10:47 AM, coach rhca <[email protected]> > wrote: > > > Could you please help .. am unable to retrieve the public ip > > address of the ec2 instance to add it to the host inventory.. > > > > - name: Create an ec2 instance > > ec2: > > key_name: "{{ keypair }}" > > group: sg_webserver_group > > instance_type: "{{ instance_type}}" > > image: "{{ ami }}" > > wait: true > > region: "{{ region }}" > > assign_public_ip: yes > > register: ec2 > > - debug: * var=ec2.instances.public_ip* (*or var=ec2.public_ip > > doesnt give the public ip rather gives undefined variable but > > whereas var=ec2 *gives all the details) > > > > > > - name: Add the newly created host > > add_host: > > name: "{{ item.public_ip }}" > > groups: webserver > > with_items: "{{ ec2.instances }}" > > > > Thank you > > > > On Sun, Aug 19, 2018 at 12:41 PM, coach rhca <[email protected]> > > wrote: > >> thanks kai.. > >> > >> On Sat, Aug 18, 2018 at 5:14 PM, Kai Stian Olstad < > >> [email protected]> wrote: > >> > >>> On Friday, 17 August 2018 06.11.03 CEST coach rhca wrote: > >>> > thanks Jonathan for reciprocating, i use the openssl on the OS > >>> > to > >>> generate > >>> > the pem file and then the crt file but i am checking on how to > >>> > achieve > >>> this > >>> > on ansible. > >>> > just like a private self signed certificate for internal use > >>> > for the webserver that will be provisioned. > >>> > >>> You can do it with the same command that you usually use, Ansible > >>> can run OS commands with the command and the shell modules. -- 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 post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/20180820182920.4e69dad4%40rovaniemi. For more options, visit https://groups.google.com/d/optout.
