Last active
April 10, 2016 09:08
-
-
Save swasher/0e7069f18f0f4f4a05a47c63aa3a10d4 to your computer and use it in GitHub Desktop.
Script for apply ansible role
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# install pip | |
curl -s https://bootstrap.pypa.io/get-pip.py | sudo python - | |
# add path for install ansible in user mode (otherwise it can't start because not it PATH) | |
echo "export PATH=$PATH:$HOME/.local/bin" >> .bashrc | |
export PATH=$PATH:$HOME/.local/bin | |
# install ansible | |
pip install ansible --user | |
# download role to /home/user/ | |
ansible-galaxy install -p $HOME swasher.dotfiles | |
# provide vault password | |
echo 'password' > swasher.dotfiles/vault_password | |
# create playbook | |
echo "---" > dotfiles.yml | |
echo "- hosts: localhost" >> dotfiles.yml | |
echo " roles:" >> dotfiles.yml | |
echo " - swasher.dotfiles" >> dotfiles.yml | |
# start playbook | |
ansible-playbook dotfiles.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment