Hi all,
I have a rather simple usecase for which I don't seem to find an answer.
How can I ping a AWS/ec2 instance from another instance in a different
play? I'm using the dynamic inventory.
The scenario is like this:
I create two ec2 instance in a play like this:
ec2:
group: "{{ security_group }}"
instance_type: "{{ instance_type }}"
image: "{{ image }}"
region: "{{ region }}"
key_name: "{{ keypair }}"
instance_tags:
Name: Destination
ec2:
group: "{{ security_group }}"
instance_type: "{{ instance_type }}"
image: "{{ image }}"
region: "{{ region }}"
key_name: "{{ keypair }}"
instance_tags:
Name: Source
This works well, the nodes are started and I can see them when running
./ec2.py
Then, in another play (ping.yml) I want to do this
- name: pinging host
hosts: tag_Name_Source
remote_user: ubuntu
tasks:
- shell: ping {{ tag_Name_Destination }}
I run it with
ansible-playbook -i ec2.py ping.yml
but it gives me "One or more undefined variables: 'tag_Name_Destination' is
undefined"
What is the right way to get the IP of the target machine?
I'm running Ansible 1.8.2 on Ubuntu.
Thanks for any hints.
/Sven
--
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/2e04f49d-d154-471e-89fd-0d626866ae4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.