commit debe2974564da17a80a5311592cd85aa7884d6c6 Author: shmick Date: Fri Nov 24 08:38:22 2023 +0200 Initial commit - system update playbook diff --git a/.gitea/workflows/hatarashi-pasokom.yaml b/.gitea/workflows/hatarashi-pasokom.yaml new file mode 100644 index 0000000..2294664 --- /dev/null +++ b/.gitea/workflows/hatarashi-pasokom.yaml @@ -0,0 +1,37 @@ +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 + 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 }}"' hatarashi-pasokom.yaml diff --git a/hatarashi-pasokom.yaml b/hatarashi-pasokom.yaml new file mode 100644 index 0000000..3f1736b --- /dev/null +++ b/hatarashi-pasokom.yaml @@ -0,0 +1,18 @@ +--- +- name: Update all packages (Debian) + hosts: takahe + become: yes + vars: + ansible_ssh_common_args: '-o StrictHostKeyChecking=no' + ansible_sudo_pass: "{{ ANSIBLE_SUDO_PASS }}" + + tasks: + - name: Update package cache + apt: + update_cache: yes + + - name: Upgrade all packages + apt: + upgrade: yes + autoremove: yes + autoclean: yes