5

I've being trying to run this ansible playbook to get a AWS resource tags:

- name: list resource tags local_action: ec2_tag resource=i-abcdefg region=us-east-1 state=list register: result

And this error is returned:

failed: [ec2-11-222-333-444.compute-1.amazonaws.com] => {"failed": true, "parsed": false} invalid output was: [sudo via ansible, key=heoqwlqnhxlxyzwnxmtbvmdtvmvjbsux] password:

FATAL: all hosts have already failed -- aborting

How can I fix that

1 Answer 1

13

You cannot run this local_action as root. Change your task to be:

- name: list resource tags sudo: false local_action: ec2_tag resource=i-abcdefg region=us-east-1 state=list register: result

2
  • Any idea why this is?
    – Eli
    Commented Jun 23, 2015 at 21:58
  • Perhaps because it would require a password and ansible cannot provide it.
    – douglaslps
    Commented Jun 24, 2015 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.