prole/infrastructure/roles/netplan_static/tests/render_template.yml
chrisfu cf6d79f505 ansible: fix netplan_static YAML, dashboard conky pkg, mariadb vault vars
- netplan_static: avoid Jinja whitespace/indent YAML breakage with trim_blocks; set /etc/netplan perms to 0600; add render+YAML-parse test

- dashboard: install concrete conky provider (conky-all) and add defaults test; wire role into site.yml; document dashboard service usage

- mariadb: add mariadb parent group for group_vars scope; add group defaults deriving datastore password from vault; add vault entry; add vars resolution test; remove host overrides

- misc: update port-forward mappings, generated prole.cfg, and bump prole-db version

Co-authored-by: Junie <junie@jetbrains.com>
2026-03-05 23:02:42 -08:00

30 lines
975 B
YAML

---
- name: Render netplan_static template and verify YAML is valid
hosts: localhost
connection: local
gather_facts: false
become: false
vars:
# Representative values (mirrors `inventory/host_vars/merlin.prole.org.yml`)
netplan_static_iface_effective: eth0
netplan_static_address: 10.0.0.6/24
netplan_static_gateway4_effective: 10.0.0.1
netplan_static_nameservers_effective:
- 10.0.0.1
_rendered_path: /tmp/netplan_static_rendered.yaml
tasks:
- name: Render template
ansible.builtin.template:
src: "{{ playbook_dir }}/../templates/99-ansible-static.yaml.j2"
dest: "{{ _rendered_path }}"
mode: "0600"
- name: Parse rendered YAML with the same Python used by ansible-playbook
ansible.builtin.command: >-
{{ ansible_playbook_python }} -c
"import yaml; yaml.safe_load(open('{{ _rendered_path }}', 'r', encoding='utf-8').read()); print('YAML ok')"
changed_when: false