what is the content of your aws_keys.txt ? 

Normally the file used with the include statement has .yml extension. Not 
sure if that makes any difference

On Friday, March 9, 2018 at 2:29:12 PM UTC-8, sanjanith reddy wrote:
>
> Hi All,
> I'm trying to launch an EC2 instance via a playbook. My playbook contents 
> are like this:
>
> ---
>
> - name: Create an EC2 Instance
>
>   hosts: localhost
>
>   gather_facts: false
>
>
>   vars:
>
>     keypair: Ansible_demo
>
>     instance_type: t2.micro
>
>     amiid: ami-72aba312
>
>     region: us-west-1
>
>
>   tasks:
>
>   - include_vars: aws_keys.txt
>
>   - name: Launch Instance
>
>     ec2:
>
>        key_name: "{{ keypair }}"
>
>        group: default
>
>        instance_type: "{{ instance_type }}"
>
>        image: "{{ amiid }}"
>
>        region: "{{ region }}"
>
>        wait: true
>
>
> I did use vault and create aws_key.txt file.
>
>
> Error i get is this: 
>
>
> fatal: [localhost]: FAILED! => {"ansible_facts": {}, 
> "ansible_included_var_files": [], "changed": false, "message": 
> "/home/centos/Ansible/aws_keys.txt must be stored as a dictionary/hash"}
>
> to retry, use: --limit @/home/centos/Ansible/ec2-launch.retry
>
>
> Please suggest me a soliution.
>

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9aeded2b-faf7-4961-a074-e1ba2e88c8a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to