Last active
September 2, 2021 07:59
-
-
Save mattpwest/e1b979edac93b81824da9a5dfb774191 to your computer and use it in GitHub Desktop.
Vagrant - Ubuntu 18.04: Provision Ansible with Python 3
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
if [ ! -f "/home/vagrant/.ssh/id_rsa" ]; then | |
ssh-keygen -t rsa -N "" -f /home/vagrant/.ssh/id_rsa | |
fi | |
cp /home/vagrant/.ssh/id_rsa.pub /vagrant/control.pub | |
cat << 'SSHEOF' > /home/vagrant/.ssh/config | |
Host * | |
StrictHostKeyChecking no | |
UserKnownHostsFile=/dev/null | |
SSHEOF | |
chown -R vagrant:vagrant /home/vagrant/.ssh/ | |
sudo apt-get update | |
sudo apt-get install -y python3 python3-pip | |
sudo pip3 install ansible | |
cd /vagrant | |
ansible-galaxy install -r requirements.yml | |
cp -R /root/.ansible /home/vagrant/. | |
chown -R vagrant:vagrant /home/vagrant/.ansible |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment