# SPDX-License-Identifier: MIT-0 # Renders every template with throwaway values; no cluster access. # ansible-playbook tests/render.yml -e out=/tmp/listmonk-render - name: Render listmonk role templates hosts: localhost connection: local gather_facts: false vars: role_path: "{{ playbook_dir }}/.." out: "{{ playbook_dir }}/../.render" tasks: - name: Load role defaults ansible.builtin.include_vars: "{{ role_path }}/defaults/main.yml" - name: Throwaway secrets ansible.builtin.set_fact: listmonk_db_password: render-only-db-password listmonk_admin_password: render-only listmonk_smtp_password: render-only listmonk_oidc_client_secret: render-only listmonk_api_token: render-only-api-token listmonk_newsletter_api_token: render-only-newsletter-token - name: Output directory ansible.builtin.file: path: "{{ out }}" state: directory mode: "0700" - name: Render ansible.builtin.template: src: "{{ role_path }}/templates/{{ item }}.j2" dest: "{{ out }}/{{ item }}" mode: "0600" loop: [secret.yml, postgres.yml, listmonk.yml, configure.sql, email-configmap.yml] - name: Manifests parse as YAML ansible.builtin.assert: that: lookup('ansible.builtin.file', out ~ '/' ~ item) | from_yaml_all | list | length > 0 quiet: true loop: [secret.yml, postgres.yml, listmonk.yml, email-configmap.yml]