56 lines
1.9 KiB
YAML
56 lines
1.9 KiB
YAML
name: Run ansible playbooks
|
|
|
|
on:
|
|
schedule:
|
|
- cron: '@daily'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
update-packages:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: alpine/ansible:2.18.6
|
|
steps:
|
|
- name: Setup environment
|
|
run: |
|
|
apk add git
|
|
git clone https://gitea.akshun-lab.uk/akshun/ansible.git /mnt
|
|
echo -e "${{ secrets.ANSIBLE_PRIVATE_KEY }}" > /mnt/default-key && \
|
|
echo "${{ secrets.ANSIBLE_BECOME_PASS }}" > /mnt/become-pass.txt && \
|
|
chmod 600 /mnt/default-key
|
|
- name: Update packages
|
|
run: |
|
|
ansible-playbook -i inventory.yml --vault-pass-file /mnt/become-pass.txt --key-file /mnt/default-key /mnt/playbooks/update-packages.yml
|
|
|
|
prune-images:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: alpine/ansible:2.18.6
|
|
steps:
|
|
- name: Setup environment
|
|
run: |
|
|
apk add git
|
|
git clone https://gitea.akshun-lab.uk/akshun/ansible.git /mnt
|
|
echo -e "${{ secrets.ANSIBLE_PRIVATE_KEY }}" > /mnt/default-key && \
|
|
echo "${{ secrets.ANSIBLE_BECOME_PASS }}" > /mnt/become-pass.txt && \
|
|
chmod 600 /mnt/default-key
|
|
- name: Prune ctr images
|
|
run: |
|
|
ansible-playbook -i inventory.yml --vault-pass-file /mnt/become-pass.txt --key-file /mnt/default-key /mnt/playbooks/prune-k3s.yml
|
|
|
|
update-proxmox:
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: alpine/ansible:2.18.6
|
|
steps:
|
|
- name: Setup environment
|
|
run: |
|
|
apk add git
|
|
git clone https://gitea.akshun-lab.uk/akshun/ansible.git /mnt
|
|
echo -e "${{ secrets.ANSIBLE_PRIVATE_KEY }}" > /mnt/default-key && \
|
|
echo "${{ secrets.ANSIBLE_BECOME_PASS }}" > /mnt/become-pass.txt && \
|
|
chmod 600 /mnt/default-key
|
|
- name: Update proxmox nodes
|
|
run: |
|
|
ansible-playbook -i inventory.yml --vault-pass-file /mnt/become-pass.txt --key-file /mnt/default-key /mnt/playbooks/update-proxmox.yml
|