Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ansible local_action returns error "invalid output was: [sudo via ansible, key=xxx] password:"

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

like image 944
douglaslps Avatar asked Jun 25 '14 16:06

douglaslps


1 Answers

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

like image 83
douglaslps Avatar answered Nov 03 '22 07:11

douglaslps