Compare commits

...

3 Commits

Author SHA1 Message Date
60299aa778 Update .gitea/workflows/hatarashi-hako.yaml 2024-02-09 12:00:43 +02:00
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
3 changed files with 47 additions and 40 deletions

View File

@@ -1,39 +1,39 @@
name: Ansible Deploy
on:
push:
schedule:
- cron: '00 23 * * *'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Python
run: |
apt -y update
apt -y install python3 python3-pip skopeo
- name: Install Ansible
run: |
python3 -m pip install --upgrade pip
pip install ansible
- name: Set up SSH
uses: webfactory/ssh-agent@v0.5.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- 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
name: Ansible Deploy
#on:
# push:
# schedule:
# - cron: '00 23 * * *'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Python
run: |
apt -y update
apt -y install python3 python3-pip skopeo
- name: Install Ansible
run: |
python3 -m pip install --upgrade pip
pip install ansible
- name: Set up SSH
uses: webfactory/ssh-agent@v0.5.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- 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
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 }}"
tasks:
- name: Install Skopeo
- name: Install Dependencies
ansible.builtin.package:
name: skopeo
state: latest