Created
January 10, 2023 15:34
-
-
Save jDmacD/3a0dc75bd911513e89b126e06cd5b933 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
apt update | |
apt install python3-pip python3.10-venv -y | |
cat << EOF > /var/run/ops_pull_rsa | |
-----BEGIN OPENSSH PRIVATE KEY----- | |
<GITHUB DEPLOY KEY> | |
-----END OPENSSH PRIVATE KEY----- | |
EOF | |
chmod 400 /run/ops_pull_rsa | |
mkdir -p /opt/python-venv | |
cd /opt/python-venv | |
python3 -m venv ansible | |
source ansible/bin/activate | |
cat << EOF > ./requirements.txt | |
ansible | |
oci | |
oci-cli | |
kubernetes | |
jsonpatch | |
EOF | |
python3 -m pip install --upgrade pip | |
python3 -m pip install -r requirements.txt | |
ansible-galaxy collection install kubernetes.core | |
ansible-galaxy install oracle.oci_ansible_modules | |
ansible-pull \ | |
--accept-host-key \ | |
--url [email protected]:<YOUR REPO>.git \ | |
--private-key /var/run/ops_pull_rsa \ | |
--limit localhost \ | |
--tags configure,oci,deploy \ | |
ansible/playbooks/k3s.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment