From 48b987180ac1115f10c1d324d47690d8ac4bd8c6 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Thu, 4 Jul 2024 15:35:41 +0200 Subject: [PATCH] Move firewall_master role to servers repo --- roles/certbot_dns/tasks/main.yml | 54 --------- roles/certbot_dns/templates/certbot-auth.j2 | 13 --- .../certbot_dns/templates/certbot-cleanup.j2 | 11 -- roles/certbot_dns/templates/krb5.conf.j2 | 18 --- roles/firewall_master/files/accept-fri.nft | 16 --- roles/firewall_master/files/friwall.ini | 16 --- roles/firewall_master/files/pusher.initd | 18 --- roles/firewall_master/files/uwsgi.ini | 2 - roles/firewall_master/handlers/main.yml | 39 ------- roles/firewall_master/tasks/mail.yml | 9 -- roles/firewall_master/tasks/main.yml | 42 ------- roles/firewall_master/tasks/user.yml | 14 --- roles/firewall_master/tasks/web.yml | 110 ------------------ roles/firewall_master/templates/interfaces.j2 | 14 --- .../templates/networks.json.j2 | 8 -- roles/firewall_master/templates/nginx.conf.j2 | 21 ---- roles/firewall_master/templates/nodes.json.j2 | 10 -- .../templates/settings.json.j2 | 10 -- setup.yml | 5 - 19 files changed, 430 deletions(-) delete mode 100644 roles/certbot_dns/tasks/main.yml delete mode 100644 roles/certbot_dns/templates/certbot-auth.j2 delete mode 100644 roles/certbot_dns/templates/certbot-cleanup.j2 delete mode 100644 roles/certbot_dns/templates/krb5.conf.j2 delete mode 100644 roles/firewall_master/files/accept-fri.nft delete mode 100644 roles/firewall_master/files/friwall.ini delete mode 100755 roles/firewall_master/files/pusher.initd delete mode 100644 roles/firewall_master/files/uwsgi.ini delete mode 100644 roles/firewall_master/handlers/main.yml delete mode 100644 roles/firewall_master/tasks/mail.yml delete mode 100644 roles/firewall_master/tasks/main.yml delete mode 100644 roles/firewall_master/tasks/user.yml delete mode 100644 roles/firewall_master/tasks/web.yml delete mode 100644 roles/firewall_master/templates/interfaces.j2 delete mode 100644 roles/firewall_master/templates/networks.json.j2 delete mode 100644 roles/firewall_master/templates/nginx.conf.j2 delete mode 100644 roles/firewall_master/templates/nodes.json.j2 delete mode 100644 roles/firewall_master/templates/settings.json.j2 diff --git a/roles/certbot_dns/tasks/main.yml b/roles/certbot_dns/tasks/main.yml deleted file mode 100644 index f60cb12..0000000 --- a/roles/certbot_dns/tasks/main.yml +++ /dev/null @@ -1,54 +0,0 @@ -- name: Enable community package repo - lineinfile: - path: /etc/apk/repositories - regexp: '^# *(http.*/v[^/]*/community)' - line: '\1' - backrefs: yes - -- name: Install packages - package: - name: bind-tools,certbot,krb5,py3-pexpect - -- name: Configure kerberos - template: - dest: /etc/krb5.conf - src: krb5.conf.j2 - -- name: Copy DNS updater scripts for certbot - template: - dest: "/usr/local/bin/{{ item }}" - src: "{{ item }}.j2" - mode: 0700 - with_items: - - certbot-auth - - certbot-cleanup - -- name: Init kerberos keytab - expect: - command: ktutil - responses: - '.*:': - - 'add_entry -password -p {{ lookup("passwordstore", "vm/"~inventory_hostname, subkey="ldap_user") }} -k 1 -e aes256-cts-hmac-sha1-96' - - '{{ lookup("passwordstore", "vm/"~inventory_hostname, subkey="ldap_pass") }}' - - 'write_kt /etc/krb5.keytab' - - 'exit' - args: - creates: /etc/krb5.keytab - -- name: Create LE account - command: - cmd: certbot register --agree-tos --register-unsafely-without-email - creates: /etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory/*/meta.json - -- name: Create LE certificate - command: - cmd: certbot certonly --quiet --manual --preferred-challenges=dns --manual-auth-hook certbot-auth --manual-cleanup-hook certbot-cleanup -d {{ fqdn }} - creates: "/etc/letsencrypt/renewal/{{ fqdn }}.conf" - -- name: Enable certbot renewal - cron: - name: "certbot renew" - job: "certbot renew --quiet" - user: root - hour: "2,14" - minute: "38" diff --git a/roles/certbot_dns/templates/certbot-auth.j2 b/roles/certbot_dns/templates/certbot-auth.j2 deleted file mode 100644 index f0905e8..0000000 --- a/roles/certbot_dns/templates/certbot-auth.j2 +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -dns={{ dns[0] }} -ldap_user={{ lookup("passwordstore", "vm/"~inventory_hostname, subkey="ldap_user") }} -ttl=10 - -kinit -k -t /etc/krb5.keytab "${ldap_user}" -nsupdate -g <