Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#configure awscli
- name: configure awscli
sudo: yes
shell: mkdir -p /home/vagrant/.aws && touch /home/vagrant/.aws/config
- name: change permissions
sudo: yes
shell: chmod -R 666 /home/vagrant/.aws/*
- name: create default config
sudo: yes
shell: echo "[default]" >> /home/vagrant/.aws/config
- name: add access key
sudo: yes
shell: echo "aws_access_key_id={{ ACCESS_KEY }}" >> /home/vagrant/.aws/config
- name: add secret key
sudo: yes
shell: echo "aws_secret_access_key={{ SECRET_ACCESS_KEY }}" >> /home/vagrant/.aws/config
- name: default to us-east-1
sudo: yes
shell: echo "region=us-east-1" >> /home/vagrant/.aws/config
- name: default to json. to use text, can switch to "output=text"
sudo: yes
shell: echo "output=json" >> /home/vagrant/.aws/config
- name: set config file location
sudo: yes
shell: echo 'AWS_CONFIG_FILE="/home/vagrant/.aws/config"' >> /etc/environment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment