diff --git a/.gitea/workflows/ansible-deploy.yaml b/.gitea/workflows/ansible-deploy.yaml new file mode 100644 index 0000000..6eda1ce --- /dev/null +++ b/.gitea/workflows/ansible-deploy.yaml @@ -0,0 +1,38 @@ +name: Ansible Deploy +on: + push: + branches: + - main + +jobs: + Homelab-Deploy: + runs-on: ubuntu-latest + strategy: + matrix: + playbook: + - ansible/buildHomelab.yaml + + steps: + - uses: actions/checkout@v4 + + # install ansbile + - name: Install Ansible + run: | + apt update -y + apt install python3-pip -y + python3 -m pip install -r requirements.txt + + - name: Run playbook + uses: dawidd6/action-ansible-playbook@v2 + with: + # Required, playbook filepath + playbook: ${{ matrix.playbook }} + # Optional, directory where playbooks live + directory: ./ + # Optional, SSH private key + key: ${{secrets.SSH_PRIVATE_KEY}} + vault_password: ${{secrets.VAULT_PASSWORD}} + # Optional, galaxy requirements filepath + #requirements: requirements.yaml + options: | + --inventory ansible/inventory/hosts.yaml diff --git a/ansible/assets/docker-ext/wg0.conf.j2 b/ansible/assets/docker-ext/wg0.conf.j2 index 07f0840..174b5d7 100644 --- a/ansible/assets/docker-ext/wg0.conf.j2 +++ b/ansible/assets/docker-ext/wg0.conf.j2 @@ -7,3 +7,8 @@ PublicKey = s3Ch/zcv5IeSpIbHBT5pdzpHWwV2qh4Z9W/0DSZg/CQ= AllowedIPs = 0.0.0.0/0 Endpoint = vps.mycomputer.party:51820 PersistentKeepalive = 25 + +[Peer] +PublicKey = eEHA7CSOR5nha9w4SCB+tOXcuCxgkxIXtNU3xB7wZn4= +AllowedIPs = 10.11.20.5/32 +Endpoint = vps.mycomputer.party:51820 diff --git a/ansible/buildHomelab.yaml b/ansible/buildHomelab.yaml index 409a4a3..9d9fbae 100644 --- a/ansible/buildHomelab.yaml +++ b/ansible/buildHomelab.yaml @@ -36,6 +36,7 @@ ansible.builtin.shell: systemctl restart systemd-resolved - name: Install restic + ignore_errors: true ansible.builtin.apt: update_cache: true name: diff --git a/requirements.txt b/requirements.txt index 0618547..7c1e0e9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,10 @@ ansible==8.7.0 ansible-core==2.15.11 -cffi==1.15.1 -cryptography==39.0.0 -Jinja2==3.1.2 -MarkupSafe==2.1.1 -packaging==23.0 -pycparser==2.21 -PyYAML==6.0 -resolvelib==0.8.1 +#cffi==1.15.1 +#cryptography==39.0.0 +#Jinja2==3.1.2 +#MarkupSafe==2.1.1 +#packaging==23.0 +#pycparser==2.21 +#PyYAML==6.0 +#resolvelib==0.8.1