I am trying to find an Ansible module that would allow me to set up the Secret and Access Keys for a certain user on a target machine. The command line equivalent of this would be:-
11:14:26 root@ov90-NAT ~ [33] {e=255}
# aws configure
AWS Access Key ID [None]: something
AWS Secret Access Key [None]: something
Default region name [None]: us-east-1
Default output format [None]: json
I'm fairly new to both Ansible and AWS so any help would be appreciated!
If you want to pass credentials to Ansible modules, Ansible has dedicated section on how to do it using environment variables or vars_file.
You can also explicitly set them using set command, e.g.:
aws configure set aws_access_key_id default_access_key
aws configure set aws_secret_access_key default_secret_key
aws configure set default.region us-west-2
You can also have your Ansible recipe to create the config files ~/.aws/credentials and ~/.aws/config. Their format is shown here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With