I am running a ansible script with ansible 2.4.2 to create a security and it works fine if I run the script for region us-east-1 but if I go against region us-west-2 it fails with
TASK [create the LB security group] ********************************************************************************************************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ClientError: An error occurred (AuthFailure) when calling the DescribeSecurityGroups operation: AWS was not able to validate the provided access credentials
fatal: [localhost]: FAILED! => {“changed”: false, “error”: {“code”: “AuthFailure”, “message”: “AWS was not able to validate the provided access credentials”}, “msg”: “Error in describe_security_groups: An error occurred (AuthFailure) when calling the DescribeSecurityGroups operation: AWS was not able to validate the provided access credentials”, “response_metadata”: {“http_headers”: {“date”: “Sun, 21 Jan 2018 23:53:14 GMT”, “server”: “AmazonEC2”, “transfer-encoding”: “chunked”}, “http_status_code”: 401, “request_id”: “d8bf5548-54ab-4bd6-b4dd-bfeb61ebc03c”, “retry_attempts”: 0}}
to retry, use: --limit @/Users/hrf/jelli/devops/provision/ansible/aws_asg.retry
If I run this script using ansible 2.3.2 it works fine with region us-east-1 and us-west-2. I have tried setting the ENV variables ( with my credentials but that does not seem to matter. I am running on Macbook with MacOS 10.13.2 and I have installed ansible using pip. I have upgrade to the latest boto and boto3.