From 954ab1887b20e9e0d5885c1cec8d71641cb3dcd4 Mon Sep 17 00:00:00 2001 From: Joe Carstairs Date: Thu, 13 Aug 2026 16:29:05 +0100 Subject: remove homelab config --- ansible/roles/mox/tasks/main.yml | 155 --------------------------------------- 1 file changed, 155 deletions(-) delete mode 100644 ansible/roles/mox/tasks/main.yml (limited to 'ansible/roles/mox/tasks/main.yml') diff --git a/ansible/roles/mox/tasks/main.yml b/ansible/roles/mox/tasks/main.yml deleted file mode 100644 index 2e41a4c..0000000 --- a/ansible/roles/mox/tasks/main.yml +++ /dev/null @@ -1,155 +0,0 @@ -- name: Add mox group - ansible.builtin.group: - name: mox - -- name: Add mox user - ansible.builtin.user: - name: mox - group: mox - groups: - - tls - append: false - -- name: Create mox configuration directory - register: mox_conf_dir - ansible.builtin.file: - path: ~mox/config/ - owner: mox - -- name: Create DKIM private keys directory - register: mox_dkim_dir - ansible.builtin.file: - path: ~mox/config/dkim - -- name: Install DKIM private key A - register: mox_dkim_a - ansible.builtin.copy: - src: dkim/2026a._domainkey.mail.joeac.net.20260705T163220.rsa2048.privatekey.pkcs8.pem - dest: ~mox/config/dkim/2026a._domainkey.mail.joeac.net.20260705T163220.rsa2048.privatekey.pkcs8.pem - mode: o-rwx - -- name: Install DKIM private key B - register: mox_dkim_b - ansible.builtin.copy: - src: dkim/2026b._domainkey.mail.joeac.net.20260705T163220.rsa2048.privatekey.pkcs8.pem - dest: ~mox/config/dkim/2026b._domainkey.mail.joeac.net.20260705T163220.rsa2048.privatekey.pkcs8.pem - mode: o-rwx - -- name: Install adminpasswd - register: mox_adminpasswd - ansible.builtin.copy: - src: adminpasswd - dest: ~mox/config/adminpasswd - mode: o-rwx - -- name: Install mox configuration - register: mox_conf - ansible.builtin.template: - src: mox.conf - dest: ~mox/config/mox.conf - mode: o-rwx - -- name: Install mox domain configuration - register: mox_domain_conf - ansible.builtin.template: - src: domains.conf - dest: ~mox/config/domains.conf - mode: o-rwx - -- name: Create mox data directory - ansible.builtin.file: - path: ~mox/data - state: directory - mode: o-rwx - -- name: Create unbound configuration directory - ansible.builtin.file: - path: /etc/unbound/unbound.conf.d - state: directory - mode: "444" - -- name: Install DNSSEC configuration - register: dnssec_conf - ansible.builtin.template: - src: dnssec.conf - dest: /etc/unbound/unbound.conf.d/dnssec.conf - -- name: Install unbound binary - community.general.apk: - name: unbound - state: present - -- name: Restart unbound service and configure to start on boot - when: dnssec_conf is changed - ansible.builtin.service: - name: unbound - enabled: true - state: restarted - -- name: Start unbound service and configure to start on boot - when: not ( dnssec_conf is changed ) - ansible.builtin.service: - name: unbound - enabled: true - state: started - -- name: Configure networking to point at unbound DNS resolver - ansible.builtin.copy: - content: "nameserver: 127.0.0.1" - dest: /etc/resolv.conf - backup: true - mode: "444" - -- name: Install mox binary - register: mox_binary - ansible.builtin.get_url: - dest: /usr/bin/mox - mode: "755" - url: "{{ mox_url }}" - -- name: Install mox service - register: mox_service - ansible.builtin.template: - src: openrc/mox - dest: /etc/init.d/mox - mode: "755" - -- name: Restart mox service and configure to start on boot - when: - mox_conf_dir is changed - or mox_dkim_dir is change - or mox_dkim_a is change - or mox_dkim_b is change - or mox_adminpasswd is change - or mox_conf is change - or mox_domain_conf is changed - or mox_binary is changed - or mox_service is changed - ansible.builtin.service: - name: mox - enabled: true - state: restarted - -- name: Start mox service and configure to start on boot - when: not ( - mox_conf_dir is changed - or mox_dkim_dir is change - or mox_dkim_a is change - or mox_dkim_b is change - or mox_adminpasswd is change - or mox_conf is change - or mox_domain_conf is changed - or mox_binary is changed - or mox_service is changed ) - ansible.builtin.service: - name: mox - enabled: true - state: started - -- name: Set account passwords - loop: "{{ email_accounts }}" - no_log: true - ansible.builtin.command: - cmd: mox setaccountpassword {{ item.name }} - stdin: "{{ item.password }}" - chdir: ~mox -- cgit v1.2.3