- python2.7 latest installed on your system
- root user with sudo privileges
sudo xcode-select --install
sudo easy_install pip
pip --version
sudo pip install --user --upgrade pip
sudo pip install --user --upgrade ansible
By default, we don't have an existing Ansible Inventory, but we can run ansible with localhost as the target
ansible localhost -m ping
localhost | SUCCESS => {
"changed": false,
"ping": "pong"
}
ansible localhost -m setup -a 'filter=ansible_distribution'
localhost | SUCCESS => {
"ansible_facts": {
"ansible_distribution": "MacOSX"
},
"changed": false
}
ansible localhost -a 'uname -a'
localhost | SUCCESS | rc=0 >>
Darwin vchepeli-OSX.local 17.5.0 Darwin Kernel Version 17.5.0: Fri Apr 13 19:32:32 PDT 2018; root:xnu-4570.51.2~1/RELEASE_X86_64 x86_64
This does a user installation to prevent breaking any system-wide packages
virtualenv --python=python2.7 .venv
source .venv/bin/activate
chmod +x <project-name>-openrc.sh
./<project-name>-openrc.sh
export AWS_ACCESS_KEY_ID=<your-aws-access-key-id>
export AWS_SECRET_ACCESS_KEY=<your-aws-secret-access-key>
git clone [email protected]:vchepeli/aws-performance.git && cd aws-performance
openssl rand -base64 15 > .password
ansible-vault --vault-password-file=.password create secret.yml
vault_jenkins_username: <your-username>
vault_jenkins_password: <your-password>
vault_jenkins_url: <jenkins-master-url>
my ansible_host=127.0.0.1 ansible_user=<your-local-username> ansible_connection=local
ssh-keygen -t rsa -b 2048 -C "<your-email-address>" -f ~/.ssh/ec2.centos -q -N ""
ssh-keygen -t rsa -b 2048 -C "<your-email-address>" -f ~/.ssh/ec2.jenkins -q -N ""
ansible-playbook -i hosts play.yml --vault-password-file .password --ask-become-pass
ansible-playbook -i hosts play.yml --vault-password-file .password --ask-become-pass --tags='destroy'