From 7aaa0a66862eef43fd17454b57a2daa60b3f7a26 Mon Sep 17 00:00:00 2001 From: Justus Grunow Date: Mon, 18 Nov 2024 07:06:15 -0500 Subject: [PATCH 1/9] Added ansible-deploy workflow --- .gitea/workflows/ansible-deploy.yaml | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .gitea/workflows/ansible-deploy.yaml diff --git a/.gitea/workflows/ansible-deploy.yaml b/.gitea/workflows/ansible-deploy.yaml new file mode 100644 index 0000000..cfff502 --- /dev/null +++ b/.gitea/workflows/ansible-deploy.yaml @@ -0,0 +1,42 @@ +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 ansible + + - name: Install Ansible Galaxy requirements + run: | + ansible-galaxy install -r requirements.yaml + + - 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.yaml From 64a43d18efb77a3f39c284449009b2eeaa187611 Mon Sep 17 00:00:00 2001 From: Justus Grunow Date: Mon, 18 Nov 2024 07:11:22 -0500 Subject: [PATCH 2/9] Removed ansible-requirements --- .gitea/workflows/ansible-deploy.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.gitea/workflows/ansible-deploy.yaml b/.gitea/workflows/ansible-deploy.yaml index cfff502..6233c5d 100644 --- a/.gitea/workflows/ansible-deploy.yaml +++ b/.gitea/workflows/ansible-deploy.yaml @@ -20,11 +20,7 @@ jobs: run: | apt update -y apt install python3-pip -y - python3 -m pip install ansible - - - name: Install Ansible Galaxy requirements - run: | - ansible-galaxy install -r requirements.yaml + python3 -m pip install -r requirements.txt - name: Run playbook uses: dawidd6/action-ansible-playbook@v2 From 26a8079e2dcfece6e56994df0da1a1245659c7cb Mon Sep 17 00:00:00 2001 From: Justus Grunow Date: Mon, 18 Nov 2024 07:14:39 -0500 Subject: [PATCH 3/9] Removed most requirements for testing workflow --- requirements.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 From f047cc233ea843fc3f194e9cfbb83dc1d89afb90 Mon Sep 17 00:00:00 2001 From: Justus Grunow Date: Mon, 18 Nov 2024 07:17:42 -0500 Subject: [PATCH 4/9] Added .venv to workflow, added requirements back --- .gitea/workflows/ansible-deploy.yaml | 4 +++- requirements.txt | 16 ++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/ansible-deploy.yaml b/.gitea/workflows/ansible-deploy.yaml index 6233c5d..b41fcfe 100644 --- a/.gitea/workflows/ansible-deploy.yaml +++ b/.gitea/workflows/ansible-deploy.yaml @@ -20,6 +20,8 @@ jobs: run: | apt update -y apt install python3-pip -y + python -m venv .venv + source .venv/bin/activate python3 -m pip install -r requirements.txt - name: Run playbook @@ -33,6 +35,6 @@ jobs: key: ${{secrets.SSH_PRIVATE_KEY}} vault_password: ${{secrets.VAULT_PASSWORD}} # Optional, galaxy requirements filepath - requirements: requirements.yaml + #requirements: requirements.yaml options: | --inventory ansible/inventory.yaml diff --git a/requirements.txt b/requirements.txt index 7c1e0e9..0618547 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 From 576b52d7774c2cba5d5ce15622e6a79640844821 Mon Sep 17 00:00:00 2001 From: Justus Grunow Date: Mon, 18 Nov 2024 07:32:27 -0500 Subject: [PATCH 5/9] Removed .venv stuff, removed most requirements --- .gitea/workflows/ansible-deploy.yaml | 2 -- requirements.txt | 16 ++++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/ansible-deploy.yaml b/.gitea/workflows/ansible-deploy.yaml index b41fcfe..a40831f 100644 --- a/.gitea/workflows/ansible-deploy.yaml +++ b/.gitea/workflows/ansible-deploy.yaml @@ -20,8 +20,6 @@ jobs: run: | apt update -y apt install python3-pip -y - python -m venv .venv - source .venv/bin/activate python3 -m pip install -r requirements.txt - name: Run playbook 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 From 0b491fb85de798a3c782558d2336dc0b12d34523 Mon Sep 17 00:00:00 2001 From: Justus Grunow Date: Thu, 21 Nov 2024 06:45:36 -0500 Subject: [PATCH 6/9] Corrected inventory location --- .gitea/workflows/ansible-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ansible-deploy.yaml b/.gitea/workflows/ansible-deploy.yaml index a40831f..24319e7 100644 --- a/.gitea/workflows/ansible-deploy.yaml +++ b/.gitea/workflows/ansible-deploy.yaml @@ -35,4 +35,4 @@ jobs: # Optional, galaxy requirements filepath #requirements: requirements.yaml options: | - --inventory ansible/inventory.yaml + --inventory ansible/ansible/hosts.yaml From a64be57ac476f312a20c5cab0017228585cf439e Mon Sep 17 00:00:00 2001 From: Justus Grunow Date: Thu, 21 Nov 2024 06:45:36 -0500 Subject: [PATCH 7/9] Corrected inventory location --- .gitea/workflows/ansible-deploy.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/ansible-deploy.yaml b/.gitea/workflows/ansible-deploy.yaml index 24319e7..6eda1ce 100644 --- a/.gitea/workflows/ansible-deploy.yaml +++ b/.gitea/workflows/ansible-deploy.yaml @@ -35,4 +35,4 @@ jobs: # Optional, galaxy requirements filepath #requirements: requirements.yaml options: | - --inventory ansible/ansible/hosts.yaml + --inventory ansible/inventory/hosts.yaml From 7869338ae0340f074cdb17073abf7fccecf1a38f Mon Sep 17 00:00:00 2001 From: Justus Grunow Date: Fri, 22 Nov 2024 07:36:42 -0500 Subject: [PATCH 8/9] Added work computer to WG --- ansible/assets/docker-ext/wg0.conf.j2 | 5 +++++ 1 file changed, 5 insertions(+) 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 From 1cdd8fe7ae296d0847fd097c0c6b48046c2197b9 Mon Sep 17 00:00:00 2001 From: justus Date: Fri, 22 Nov 2024 08:36:58 -0500 Subject: [PATCH 9/9] Update ansible/buildHomelab.yaml --- ansible/buildHomelab.yaml | 1 + 1 file changed, 1 insertion(+) 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: