Skip to content

Instantly share code, notes, and snippets.

@jDmacD
Created January 10, 2023 15:34
Show Gist options
  • Save jDmacD/3a0dc75bd911513e89b126e06cd5b933 to your computer and use it in GitHub Desktop.
Save jDmacD/3a0dc75bd911513e89b126e06cd5b933 to your computer and use it in GitHub Desktop.
#!/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 git@github.com:<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