Msg: no handler was ready for authentication. 1 handler has been checked. ['HmacAuthV4Handler'] Verify Your Credentials

So, I'm trying to run ansible in my ec2 instances on aws, for the first time in a new instance, but every time I try to start the game, I cannot get around this error message:

PLAY [localhost] ************************************************************** TASK: [make one instance] ***************************************************** failed: [localhost] => {"failed": true} msg: No handler was ready to authenticate. 1 handlers were checked. ['HmacAuthV4Handler'] Check your credentials FATAL: all hosts have already failed -- aborting PLAY RECAP ******************************************************************** to retry, use: --limit @/home/ubuntu/ans_test.retry localhost : ok=0 changed=0 unreachable=0 failed=1 

I think there might be something wrong with the permissions in my user and IAM group. I gave the IAM user and the ReadOnlyAccess group, AdministratorAccess and PowerUserAccess. I have an access identifier and a secret access key, which I set as an environment variable using the commands:

  export AWS_ACCESS_KEY_ID='AK123' export AWS_SECRET_ACCESS_KEY='abc123' 

With "AK123" and "abc123" my actual id and key values ​​are replaced. What else do I need to do in order to work with the ecs ec2 problem?

UPDATE:
I fixed the problem, I think that in fact I did not have a clear understanding of what the environment variables are. I fixed this by simply setting my aws_access_key and aws_secret_key inside my ec2 task, below is my workbook

 - hosts: localhost connection: local gather_facts: False tasks: #this task creates 5 ec2 instances that are all named demo and are copies of the image specified - name: Provision a set of instances ec2: aws_access_key: ..... aws_secret_key: .... key_name: ..... group: ..... instance_type: t2.micro image: ...... region: us-east-1 ec2_url: ....... wait: true exact_count: 5 count_tag: Name: Demo instance_tags: Name: Demo register: ec2 

I think now I need to start using the indispensable storage to just keep my key and identifier.

+8
amazon-web-services amazon-ec2 ec2-ami ansible aws-ec2
source share
4 answers

I fixed the problem, I believe that I really did not have a clear understanding of what the environment variables are. I fixed this by simply setting my aws_access_key and aws_secret_key inside my ec2 task, below is my workbook

 - hosts: localhost connection: local gather_facts: False tasks: #this task creates 5 ec2 instances that are all named demo and are copies of the image specified - name: Provision a set of instances ec2: aws_access_key: ..... aws_secret_key: .... key_name: ..... group: ..... instance_type: t2.micro image: ...... region: us-east-1 ec2_url: ....... wait: true exact_count: 5 count_tag: Name: Demo instance_tags: Name: Demo register: ec2 

I think now I need to start using the indispensable storage to just keep my key and identifier.

+3
source share

For those who are facing this problem, you can solve it by setting become/sudo: False and connection: local in the tutorial.

 --- - hosts: localhost connection: local become: False tasks: ... ... 

Hope this helps others.

+8
source share

In my case, the variables should have been in quotation marks (once or twice it does not matter).

BADLY:

 export AWS_ACCESS_KEY_ID=AK123 export AWS_SECRET_ACCESS_KEY=abc123 

OK:

 export AWS_ACCESS_KEY_ID='AK123' export AWS_SECRET_ACCESS_KEY='abc123' 

OK:

 export AWS_ACCESS_KEY_ID="AK123" export AWS_SECRET_ACCESS_KEY="abc123" 
+1
source share

The solution is well documented at Ansible doc http://docs.ansible.com/ansible/guide_aws.html

-3
source share

All Articles