From 627343b50ffaacf39c6c0cdd179ff8130327c95c Mon Sep 17 00:00:00 2001 From: michael Date: Thu, 16 May 2024 21:35:45 +1200 Subject: [PATCH] add nuc playbook --- .../nuc.balsillie.house/ansible_connection.yaml | 4 ++++ .../host_vars/nuc.balsillie.house/certbot.yaml | 11 +++++++++++ ansible/inventory/inventory.yaml | 3 +++ ansible/playbooks/infra/hv00.yaml | 2 +- ansible/playbooks/infra/nuc.yaml | 9 +++++++++ ansible/roles/certbot/tasks/main.yaml | 2 +- 6 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 ansible/inventory/host_vars/nuc.balsillie.house/ansible_connection.yaml create mode 100644 ansible/inventory/host_vars/nuc.balsillie.house/certbot.yaml create mode 100644 ansible/playbooks/infra/nuc.yaml diff --git a/ansible/inventory/host_vars/nuc.balsillie.house/ansible_connection.yaml b/ansible/inventory/host_vars/nuc.balsillie.house/ansible_connection.yaml new file mode 100644 index 0000000..10aea03 --- /dev/null +++ b/ansible/inventory/host_vars/nuc.balsillie.house/ansible_connection.yaml @@ -0,0 +1,4 @@ +ansible_connection: local +ansible_user: ladmin +ansible_become_user: root +ansible_become_method: sudo diff --git a/ansible/inventory/host_vars/nuc.balsillie.house/certbot.yaml b/ansible/inventory/host_vars/nuc.balsillie.house/certbot.yaml new file mode 100644 index 0000000..b3b374b --- /dev/null +++ b/ansible/inventory/host_vars/nuc.balsillie.house/certbot.yaml @@ -0,0 +1,11 @@ +certbot_rfc2136_server: '10.208.240.1' +certbot_rfc2136_key_name: 'rndc-house' +certbot_rfc2136_key_algorithm: 'hmac-sha256' + +certbot_webserver_type: 'nginx' # 'nginx' or 'apache' +certbot_dns_plugin: 'rfc2136' +certbot_email: "certbot.kodi00@balsillie.email" +certbot_acme_server: "acme-v02.api.letsencrypt.org" + +certbot_domains: + - xmr.balsillie.house diff --git a/ansible/inventory/inventory.yaml b/ansible/inventory/inventory.yaml index 4a775b6..88ddaf6 100644 --- a/ansible/inventory/inventory.yaml +++ b/ansible/inventory/inventory.yaml @@ -23,6 +23,7 @@ all: kube00.balsillie.house: lat5420.balsillie.house: lat7490.balsillie.house: + nuc.balsillie.house: servers: children: hypervisors: @@ -53,6 +54,7 @@ all: lat5420.balsillie.house: sff.balsillie.house: kodi00.balsillie.house: + nuc.balsillie.house: windows: hosts: lat7490.balsillie.house: @@ -66,6 +68,7 @@ all: sff.balsillie.house: mp00.balsillie.house: kodi00.balsillie.house: + nuc.balsillie.house: kodi: hosts: kodi00.balsillie.house: diff --git a/ansible/playbooks/infra/hv00.yaml b/ansible/playbooks/infra/hv00.yaml index 93297d0..584520d 100644 --- a/ansible/playbooks/infra/hv00.yaml +++ b/ansible/playbooks/infra/hv00.yaml @@ -6,5 +6,5 @@ gather_facts: true become: true roles: - - role: aur_repo_host + # - role: aur_repo_host - role: nginx diff --git a/ansible/playbooks/infra/nuc.yaml b/ansible/playbooks/infra/nuc.yaml new file mode 100644 index 0000000..cdf2b30 --- /dev/null +++ b/ansible/playbooks/infra/nuc.yaml @@ -0,0 +1,9 @@ +--- + +- name: Setup NUC + hosts: + - nuc.balsillie.house + gather_facts: true + become: true + roles: + - role: certbot diff --git a/ansible/roles/certbot/tasks/main.yaml b/ansible/roles/certbot/tasks/main.yaml index 1b1a404..6d6d2b4 100644 --- a/ansible/roles/certbot/tasks/main.yaml +++ b/ansible/roles/certbot/tasks/main.yaml @@ -49,7 +49,7 @@ - "{{ item }}" creates: /etc/letsencrypt/live/{{ item }}/fullchain.pem loop: "{{ certbot_domains }}" - notify: "{{ certbot_notify }}" + notify: "{{ certbot_notify | default(omit) }}" - name: Enable certbot renewal ansible.builtin.service: