feat(cert-manager): Add Cloudns issuer and DNS-01 challenge support

- Introduced a new Cloudns issuer configuration for cert-manager.
- Created separate tasks for DNS-01 and HTTP-01 challenge issuers.
- Updated cert-manager tasks to include Cloudns provider and manage secrets.
- Refactored existing LetsEncrypt issuer registration to use new task structure.
- Added necessary Kubernetes resources for Cloudns integration, including RBAC and certificates.
- Updated Terraform configurations to support new DNS records and service changes.
- Adjusted deployment strategies for CoreDNS and Open WebUI applications.
This commit is contained in:
2025-06-07 20:39:38 +02:00
parent 3cda0b5624
commit 01bf71f8d2
25 changed files with 590 additions and 17396 deletions
+61
View File
@@ -0,0 +1,61 @@
---
- name: Obtain Let's Encrypt SSL certificate using ClouDNS
hosts: certbot
become: true
tasks:
- name: Set required facts
ansible.builtin.set_fact:
cloudns_credentials_path: "/etc/letsencrypt/cloudns.ini"
- name: Check if cloudDNS credentials are set or fail
when: not (cloudns_auth_id is defined and cloudns_auth_password is defined)
ansible.builtin.fail:
msg: "CloudDNS credentials are not set"
- name: Check if cloudDNS nameserver is set or fail
when: not (cloudns_nameserver is defined)
ansible.builtin.fail:
msg: "CloudDNS nameserver is not set"
- name: Install Certbot and dependencies
when: ansible_os_family == "RedHat"
ansible.builtin.dnf:
name:
- certbot
state: present
- name: Install cloudDNS plugin dependencies
ansible.builtin.pip:
name:
- certbot-dns-cloudns
state: present
- name: Create ClouDNS credentials file
ansible.builtin.copy:
dest: "{{ cloudns_credentials_path }}"
content: |
dns_cloudns_auth_id={{ cloudns_auth_id }}
dns_cloudns_auth_password={{ cloudns_auth_password }}
owner: root
group: root
mode: '0600'
- name: Obtain SSL certificate using Certbot with ClouDNS plugin
ansible.builtin.command: >
certbot certonly --authenticator dns-cloudns
--non-interactive
--agree-tos
--email {{ certbot_email }}
--dns-cloudns-credentials {{ cloudns_credentials_path }}
--dns-cloudns-nameserver {{ cloudns_nameserver }} -d {{ item }}
args:
creates: "/etc/letsencrypt/live/{{ item }}/fullchain.pem"
loop: "{{ certbot_domains }}"
- name: Set up automatic certificate renewal
ansible.builtin.cron:
name: "Renew Let's Encrypt certificates"
job: "certbot renew --quiet"
minute: 0
hour: 3