Skip to content

Instantly share code, notes, and snippets.

@ddepaoli3
Last active June 20, 2017 13:20
Show Gist options
  • Save ddepaoli3/acfa1bbaa0c690fae4f3dcde47b0d642 to your computer and use it in GitHub Desktop.
Save ddepaoli3/acfa1bbaa0c690fae4f3dcde47b0d642 to your computer and use it in GitHub Desktop.
Bootstrap to install and configure ubuntu 16.04 to allow it to run ansible locally and to clone git repo from codecommit
#!/bin/bash
#Install prerequisities
sudo apt-get update
sudo apt-get install --yes python2.7 git ansible awscli
#Go to home
export HOME='/root'
cd $HOME
#Git cloning
git config --global credential.helper '!aws codecommit credential-helper $@'
git config --global credential.UseHttpPath true
git clone https://git-codecommit.eu-west-1.amazonaws.com/v1/repos/repositoryname
#Execute ansible
cd $HOME/repositoryname
ansible-playbook -i "localhost,groupname" -c local main.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment