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.
amazon-web-services amazon-ec2 ec2-ami ansible aws-ec2
Alex cohen
source share