Did you debug the var: aws_current_az?
A possible problem could be, that is a list or not set correctly.


Am Montag, 18. September 2017 02:35:33 UTC+2 schrieb Anuj Dogra:
>
> I have the following tasks in my ansible playbook to register the AZ for 
> an AWS resource:
>
> - name: Get current AZ from AWS.
>   uri:
>     url: 
> http://169.254.169.254/latest/meta-data/placement/availability-zone
>     return_content: yes
>   register: aws_current_az
>
> - name: Ensure EFS volume is mounted.
>   mount:
>     name: "{{ efs_mount_dir }}"
>     src: "{{ aws_current_az.content }}.{{ efs_file_system_id }}.efs.{{ 
> aws_region }}.amazonaws.com:/"
>     fstype: nfs4
>     opts: nfsvers=4.1
>     state: mounted
>
> However, I am encountering the following error when I check the diff on 
> the ansible playbook:
> *FAILED! => {"failed": true, "msg": "the field 'args' has an invalid 
> value, which appears to include a variable that is undefined. The error 
> was: 'dict object' has no attribute 'content*
>
> The 'content' being registered in the first task, does not register in the 
> second. 
>
> This is causing my idempotency checks to fail. These tasks work fine when 
> running, but only fail when checking the difference. Any idea why?
>
> FYI: Using the following geerlingguy Ansible playbook: 
> https://www.jeffgeerling.com/blog/2017/mount-aws-efs-filesystem-on-ec2-instance-ansible
>  
>
> Thanks in advance.
>

-- 
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/6bbe20b7-c8fd-4d53-9482-1740b4d1bc73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to