I just realized that it was running the command as root and probably using the incorrect credentials.
I just added sudo: false and it is now working. Thanks for your attention. On Wednesday, June 25, 2014 2:11:45 PM UTC-3, James Cammarata wrote: > > Are you using the ec2.py inventory script to retrieve the inventory? If > so, the ec2 tag you've specified would be a group name, and the "-" would > be turned into an underscore character (all dashes are). > > Also, the last error indicates a problem with your AWS credentials. If > you're running the command remotely, that would most likely be why. > > > On Tue, Jun 24, 2014 at 11:51 AM, Douglas Lopes Pereira < > [email protected] <javascript:>> wrote: > >> I've being trying to get the tag "Name" I've created for my ec2 instance >> using the ec2_tag module with this task file: >> $cat getTagTask.yml >> >> - name: Testing >> action: ec2_facts >> tags: [metric-alarms] >> >> - name: list resource tags >> local_action: ec2_tag resource=ansible_ec2_instance-id region=us-east-1 >> state=list >> tags: [metric-alarms] >> >> I'm running this task file as part of a playbook. Something like: >> $ cat myEnv.yml >> >> #!./ansi-playbook >> >> - include: playbooks/config/component.yml env_tag=tag_environment_perf >> >> The command I'm using to run this specific ansible tag is: >> ./myEnv.yml -l tag_Name_myInstanceName-0 -t metric-alarms -vvvvv >> >> Which means run tag 'metric-alarms' for all instances that have the tag >> Name equals myInstanceName-0 >> Unfortunately I get this error: >> >> failed: [ec2-11-222-333-444.compute-1.amazonaws.com] => {"failed": true, >> "parsed": false} >> invalid output was: [sudo via ansible, >> key=yuojjsthkixxxxircogegeobqhnzhqmp] password: >> >> >> FATAL: all hosts have already failed -- aborting >> >> If I change local_action to action, I then get this other error: >> >> failed: [ec2-11-222-333-444.compute-1.amazonaws.com] => {"failed": true} >> msg: No handler was ready to authenticate. 1 handlers were checked. >> ['QuerySignatureV2AuthHandler'] Check your credentials >> >> FATAL: all hosts have already failed -- aborting >> >> Can someone help me to fix it? >> >> -- >> 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] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/c5b90ede-939f-4277-ada4-3b0af1745e07%40googlegroups.com >> >> <https://groups.google.com/d/msgid/ansible-project/c5b90ede-939f-4277-ada4-3b0af1745e07%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- 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/8d1a829c-c773-4a7f-bafc-6da124dc6850%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
