Compare commits

...

9 Commits

Author SHA1 Message Date
48f06c53f3 Merge remote-tracking branch 'refs/remotes/origin/main'
Some checks are pending
Ansible Deploy / deploy (push) Has started running
2023-11-24 20:09:24 +02:00
20cb8a5a70 Remove Prometheus file after 5 minutes; remove inotify dependency 2023-11-24 20:09:18 +02:00
b7ad335c02 Add schedule :)
All checks were successful
Ansible Deploy / deploy (push) Successful in 1m3s
2023-11-24 08:31:26 +02:00
bf45b66782 Inventory is no more
All checks were successful
Ansible Deploy / deploy (push) Successful in 1m4s
2023-11-21 23:03:31 +02:00
98e05fe930 Update .gitea/workflows/hatarashi-hako.yaml
All checks were successful
Ansible Deploy / deploy (push) Successful in 1m4s
2023-11-21 22:48:56 +02:00
a1462c543b Update .gitea/workflows/hatarashi-hako.yaml
All checks were successful
Ansible Deploy / deploy (push) Successful in 54s
2023-11-21 22:43:15 +02:00
5e4ecc9447 Update .gitea/workflows/hatarashi-hako.yaml
All checks were successful
Ansible Deploy / deploy (push) Successful in 58s
2023-11-21 22:41:18 +02:00
7fb05e9b58 Update .gitea/workflows/hatarashi-hako.yaml
Some checks failed
Ansible Deploy / deploy (push) Has been cancelled
2023-11-21 22:40:29 +02:00
e337369951 Use inventory from split Ansible repository
Some checks failed
Ansible Deploy / deploy (push) Failing after 1m0s
2023-11-21 22:34:29 +02:00
4 changed files with 47 additions and 37 deletions

View File

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

View File

@@ -141,3 +141,10 @@ for container_path in ${CONTAINER_PATHS[@]}; do
cd $LOCAL_DIR cd $LOCAL_DIR
done done
echo "All done!" echo "All done!"
## Once the script finishes, the .prom file will live on for 5 minutes before being deleted.
#+ This allows Prometheus to pick up the alert, send out a notification, and move on with its life.
(
sleep 300
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 Skopeo - name: Install Dependencies
ansible.builtin.package: ansible.builtin.package:
name: skopeo name: skopeo
state: latest state: latest

View File

@@ -1,5 +0,0 @@
all:
hosts:
takahe:
ansible_host: 192.168.0.66
ansible_user: shmick