diff --git a/content/post/setting-up-gitea-actions-with-tailscale/index.md b/content/post/setting-up-gitea-actions-with-tailscale/index.md index 33aede27..3ac3e88f 100644 --- a/content/post/setting-up-gitea-actions-with-tailscale/index.md +++ b/content/post/setting-up-gitea-actions-with-tailscale/index.md @@ -155,7 +155,7 @@ After this, I wanted to make sure that some of my existing workflows could be mi The following workflow uses a matrix to run a job for several of my hosts using ansible playbooks that will do various tasks such as patching os updates and updating container images. ```yaml -name: Run ansible playbooks +name: Run ansible on: push: schedule: @@ -168,8 +168,7 @@ jobs: matrix: host: - changedetection - - grafana - - homer + - homelab - invidious - jackett - ladder @@ -180,7 +179,7 @@ jobs: - uptime-kuma steps: - name: Check out repository code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install ansible run: | apt update && apt install ansible -y @@ -192,7 +191,26 @@ jobs: key: ${{ secrets.SSH_PRIVATE_KEY}} options: | --inventory inventory + --ssh-extra-args "-o StrictHostKeyChecking=no" --limit ${{ matrix.host }} + send-failure-notification: + needs: run-ansible-playbook + runs-on: ubuntu-latest + if: always() && failure() + steps: + - name: Send failure notification + uses: dawidd6/action-send-mail@v3 + with: + server_address: smtp.gmail.com + server_port: 465 + secure: true + username: myuser + password: ${{ secrets.MAIL_PASSWORD }} + subject: gitea job ${{github.repository}} failed! + to: me@davegallant.ca + from: Gitea + body: | + ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }} ``` And voilĂ : diff --git a/public/blog/2023/12/10/setting-up-gitea-actions-with-tailscale/index.html b/public/blog/2023/12/10/setting-up-gitea-actions-with-tailscale/index.html index 13e266f9..43f45fb2 100644 --- a/public/blog/2023/12/10/setting-up-gitea-actions-with-tailscale/index.html +++ b/public/blog/2023/12/10/setting-up-gitea-actions-with-tailscale/index.html @@ -193,7 +193,7 @@ log:
Now it’s time start running some automation. I used the demo workflow as a starting point to verify that the runner is executing workflows.
After this, I wanted to make sure that some of my existing workflows could be migrated over.
The following workflow uses a matrix to run a job for several of my hosts using ansible playbooks that will do various tasks such as patching os updates and updating container images.
-name: Run ansible playbooks
+name: Run ansible
on:
push:
schedule:
@@ -206,8 +206,7 @@ jobs:
matrix:
host:
- changedetection
- - grafana
- - homer
+ - homelab
- invidious
- jackett
- ladder
@@ -218,7 +217,7 @@ jobs:
- uptime-kuma
steps:
- name: Check out repository code
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
- name: Install ansible
run: |
apt update && apt install ansible -y
@@ -230,7 +229,26 @@ jobs:
key: ${{ secrets.SSH_PRIVATE_KEY}}
options: |
--inventory inventory
+ --ssh-extra-args "-o StrictHostKeyChecking=no"
--limit ${{ matrix.host }}
+ send-failure-notification:
+ needs: run-ansible-playbook
+ runs-on: ubuntu-latest
+ if: always() && failure()
+ steps:
+ - name: Send failure notification
+ uses: dawidd6/action-send-mail@v3
+ with:
+ server_address: smtp.gmail.com
+ server_port: 465
+ secure: true
+ username: myuser
+ password: ${{ secrets.MAIL_PASSWORD }}
+ subject: gitea job ${{github.repository}} failed!
+ to: me@davegallant.ca
+ from: Gitea
+ body: |
+ ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }}
And voilĂ :