mirror of
https://github.com/dredx/prole.git
synced 2026-09-24 15:44:33 +00:00
Summarize CLAUDE.md updates: - Document both live GKE clusters as e2-standard-2 x3 in us-west3 and note stale app default in code. - Call out DB cluster naming mismatch between conf (knoe-dev-cnpg-0) and code default (knoe-cnpg-0). - Add SSD quota guidance: 300GB fully consumed by CNPG, so non-CNPG PVCs must use standard/pd-standard. - Refresh reset script reference and quota section details to match current runtime state. Co-authored-by: Junie <junie@jetbrains.com>
43 lines
1.6 KiB
YAML
43 lines
1.6 KiB
YAML
---
|
|
- name: Derive record name within zone from fqdn
|
|
ansible.builtin.set_fact:
|
|
samba_dns_record_name: >-
|
|
{{
|
|
(item.fqdn | regex_replace('\\.?$','')) |
|
|
regex_replace('\\.' ~ (prole_domain | regex_escape) ~ '$', '')
|
|
}}
|
|
|
|
- name: Query existing CNAME records
|
|
ansible.builtin.command:
|
|
cmd: samba-tool dns query {{ samba_dns_server }} {{ prole_domain }} {{ samba_dns_record_name }} CNAME -U {{ samba_dns_admin_user }}%{{ samba_dns_admin_pass }}
|
|
register: cname_query
|
|
changed_when: false
|
|
failed_when: false
|
|
|
|
- name: Parse existing CNAME record value
|
|
ansible.builtin.set_fact:
|
|
cname_existing_value: >-
|
|
{{
|
|
(cname_query.stdout | default('') |
|
|
regex_findall('\\bCNAME\\s+([a-zA-Z0-9.-]+)\\b') |
|
|
first | default(''))
|
|
}}
|
|
|
|
- name: Remove stale CNAME record
|
|
ansible.builtin.command:
|
|
cmd: samba-tool dns delete {{ samba_dns_server }} {{ prole_domain }} {{ samba_dns_record_name }} CNAME {{ cname_existing_value }} -U {{ samba_dns_admin_user }}%{{ samba_dns_admin_pass }}
|
|
when:
|
|
- cname_existing_value | length > 0
|
|
- cname_existing_value != item.target
|
|
|
|
- name: Add missing CNAME record
|
|
ansible.builtin.command:
|
|
cmd: samba-tool dns add {{ samba_dns_server }} {{ prole_domain }} {{ samba_dns_record_name }} CNAME {{ item.target }} -U {{ samba_dns_admin_user }}%{{ samba_dns_admin_pass }}
|
|
register: cname_add
|
|
changed_when: cname_add.rc == 0
|
|
failed_when: >
|
|
cname_add.rc != 0 and
|
|
('WERR_DNS_ERROR_RECORD_ALREADY_EXISTS' not in (cname_add.stderr | default(''))) and
|
|
('Record already exists' not in (cname_add.stderr | default('')))
|
|
when: cname_existing_value != item.target
|