From e3373699519008cf8138841974c492abade72569 Mon Sep 17 00:00:00 2001 From: shmick Date: Tue, 21 Nov 2023 22:34:29 +0200 Subject: [PATCH] Use inventory from split Ansible repository --- .gitea/workflows/hatarashi-hako.yaml | 69 +++++++++++++++------------- 1 file changed, 38 insertions(+), 31 deletions(-) diff --git a/.gitea/workflows/hatarashi-hako.yaml b/.gitea/workflows/hatarashi-hako.yaml index e985224..141fc83 100644 --- a/.gitea/workflows/hatarashi-hako.yaml +++ b/.gitea/workflows/hatarashi-hako.yaml @@ -1,31 +1,38 @@ -name: Ansible Deploy - -on: - push: - -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: 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: + +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 + uses: actions/checkout@v3 + with: + repository: shmick/ansible + ref: main # Replace with the branch or tag you want to check out + token: ${{ secrets.ANSIBLE_TOKEN }} + + - name: Run Ansible Playbook + run: | + ansible-playbook -i ansible/inventory.yaml -e 'ANSIBLE_SUDO_PASS="${{ secrets.SUDO_PASS }}" SKOPEO_PASS="${{ secrets.SKOPEO_PASS }}"' hatarashi-hako.yaml -vv