Hi,
I am having the below ansible script.
While executing the script, I am getting error in the role 'install-packages'.
The error is,
"msg": "The task includes an option with an undefined variable. The error
was: {{ ip }}: 'ip' is undefined.
It is looking for 'ip' variable inside the role 'install-packages',
Please provide your feedback..
---
# Create an EC2 instance
- name: Create EC2 Instance
hosts: "local"
connection: "local"
roles:
- ec2-provision
- name: set_facts
hosts: local
tasks:
- set_fact:
ip: "{{ ec2.instances[0].private_ip }}"
- debug:
var: ip
- name: Install packages
hosts: new_vms
gather_facts: yes
vars:
ip_addrs: "{{ ip }}"
roles:
- install-packages
--
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/cacd0e6e-f54c-450e-9892-227492d728a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.