Compare commits

..

3 Commits

Author SHA1 Message Date
c7d803e61a Update .gitea/workflows/kumonoboru.yaml 2024-02-09 12:00:12 +02:00
3853da701a Merge remote-tracking branch 'refs/remotes/origin/main'
Some checks failed
Configure Kumonoboru / deploy (push) Failing after 1m55s
2023-11-24 20:09:41 +02:00
4e67ef5394 Remove Prometheus file after 5 minutes; remove inotify dependency 2023-11-24 20:09:34 +02:00
4 changed files with 48 additions and 41 deletions

View File

@@ -1,38 +1,38 @@
name: Configure Kumonoboru name: Configure Kumonoboru
on: #on:
push: # push:
schedule: # schedule:
- cron: '30 08 * * *' # - cron: '30 08 * * *'
jobs: jobs:
deploy: deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Repository - name: Checkout Repository
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Set up Python - name: Set up Python
run: | run: |
apt -y update apt -y update
apt -y install python3 python3-pip skopeo apt -y install python3 python3-pip skopeo
- name: Install Ansible - name: Install Ansible
run: | run: |
python3 -m pip install --upgrade pip python3 -m pip install --upgrade pip
pip install ansible pip install ansible
- name: Set up SSH - name: Set up SSH
uses: webfactory/ssh-agent@v0.5.0 uses: webfactory/ssh-agent@v0.5.0
with: with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Checkout Ansible inventory - name: Checkout Ansible inventory
run: | run: |
INVENTORY_URL="https://shmick:${{ secrets.ANSIBLE_TOKEN }}@git.pukeko.xyz/shmick/ansible/raw/branch/main/inventory.yaml" INVENTORY_URL="https://shmick:${{ secrets.ANSIBLE_TOKEN }}@git.pukeko.xyz/shmick/ansible/raw/branch/main/inventory.yaml"
curl -o inventory.yaml $INVENTORY_URL curl -o inventory.yaml $INVENTORY_URL
- name: Run Ansible Playbook - name: Run Ansible Playbook
run: | run: |
ansible-playbook -i inventory.yaml -e 'ANSIBLE_SUDO_PASS="${{ secrets.SUDO_PASS }}"' kumonoboru.yaml -vv ansible-playbook -i inventory.yaml -e 'ANSIBLE_SUDO_PASS="${{ secrets.SUDO_PASS }}"' kumonoboru.yaml -vv

View File

@@ -1,3 +1,3 @@
Gerbil-TK /var/Red-Vol/Media/Pictures Gerbil-TK /var/Red-Vol/Media/Pictures
Pukeko-XYZ-Containers /var/Red-Vol/Media/Containers Pukeko-XYZ-Containers /var/Red-Vol/Media/Containers
Pukeko-XYZ-Cloud /var/Red-Vol/Media/Could Pukeko-XYZ-Cloud /var/Red-Vol/Media/Cloud

View File

@@ -192,4 +192,11 @@ for repo in "${!REPOS[@]}"; do
fi fi
done done
echo "All done; have a nice day!" echo "All done; have a nice day!"
## Once the script finishes, the .prom file will live on for 2 minutes before being deleted.
#+ This allows Prometheus to pick up the alert, send out a notification, and move on with its life.
(
sleep 120
rm $PROM_FILE
) 2>1 >/dev/null &

View File

@@ -6,7 +6,7 @@
ansible_sudo_pass: "{{ ANSIBLE_SUDO_PASS }}" ansible_sudo_pass: "{{ ANSIBLE_SUDO_PASS }}"
tasks: tasks:
- name: Install Restic - name: Install dependencies
ansible.builtin.package: ansible.builtin.package:
name: restic name: restic
state: latest state: latest