Created
November 9, 2020 23:55
-
-
Save jesseloudon/001a27b7aa0777d0a84a3fd6cf360bd4 to your computer and use it in GitHub Desktop.
ansible on azure part 2
This file contains hidden or 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
#!/bin/bash | |
# This file should be sourced | |
# Change directory to user home | |
cd /home/ansibleadmin | |
# Upgrade all packages that have available updates and remove old ones. | |
sudo apt-get update | |
sudo apt upgrade -y | |
sudo apt autoremove --assume-yes | |
# Install git | |
sudo apt install git --assume-yes | |
# Install azcli | |
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash | |
# Install venv and pip | |
sudo apt install python3-venv --assume-yes | |
sudo apt install python3-pip --assume-yes | |
# Setup virtual environment and push home folder ownership | |
sudo python3 -m venv venv | |
sudo chown ansibleadmin /home/ansibleadmin --recursive | |
# Install ansible and azure modules into virtual environment | |
pip3 install -r https://raw.githubusercontent.com/globalbao/terraform-azurerm-ansible-linux-vm/master/scripts/requirements-ansible.txt | |
pip3 install -r https://raw.githubusercontent.com/globalbao/terraform-azurerm-ansible-linux-vm/master/scripts/requirements-azure.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment