1) My inventory file:
[ec2hosts]
10.130.0.123 instance-id=i-01234567
2) My yaml file, delete-instance.yml that *works*, adapted from an
ansible example:
---
- hosts: ec2hosts
gather_facts: True
connection: local
vars:
ec2_access_key: --DELETED--
ec2_secret_key: --DELETED--
region: "us-east-1"
tasks:
- name: destroy all instances
ec2: state='absent'
aws_access_key={{ ec2_access_key }}
aws_secret_key={{ ec2_secret_key }}
region={{ region }}
instance_ids=${instance-id}
wait=true
3) If I change the line that contains ${ansible_ec2_instance-id} above to:
instance_ids={{ instance-id }}
I get this error:
TASK: [destroy all instances] *************************************************
fatal: [10.130.0.123] => unable to look up a name or access an
attribute in template string
FATAL: all hosts have already failed -- aborting
Thank you very much!
iordan
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
>
https://groups.google.com/d/topic/ansible-project/-voEAQDGNzI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
>
https://groups.google.com/d/msgid/ansible-project/-3900642294177465073%40unknownmsgid.