> podman run --name debian-bookworm -it --rm debian:bookworm root@5f208e7062e4:/# apt update Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB] Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB] Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB] Get:4 http://deb.debian.org/debian bookworm/main amd64 Packages [8793 kB] Get:5 http://deb.debian.org/debian bookworm-updates/main amd64 Packages [6924 B] Get:6 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [274 kB] Fetched 9329 kB in 1s (9260 kB/s) Reading package lists... Done Building dependency tree... Done Reading state information... Done All packages are up to date. root@5f208e7062e4:/# apt install ansible Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: ansible-core ca-certificates ieee-data krb5-locales libbsd0 libcbor0.8 libedit2 libexpat1 ... Setting up ansible (7.7.0+dfsg-3+deb12u1) ... Processing triggers for libc-bin (2.36-9+deb12u10) ... Processing triggers for ca-certificates (20230311+deb12u1) ... Updating certificates in /etc/ssl/certs... 0 added, 0 removed; done. Running hooks in /etc/ca-certificates/update.d... done. root@5f208e7062e4:/# cd $(mktemp -d) root@5f208e7062e4:/tmp/tmp.hdaDLZqsNa# cat >playbook.yaml < - name: Sample playbook hosts: localhost tasks: - name: Debug print success ansible.builtin.debug: msg: "{{ template_data }}" vars: template_data: "{{ lookup('template', 'template.txt') }}" template_opts: "{{ sample_var['sample_key'] | default('sample_default') }}" sample_var: sample_key: "sample_value" - name: Debug print failure ansible.builtin.debug: msg: "{{ template_data }}" vars: template_data: "{{ lookup('template', 'template.txt') }}" template_opts: "{{ sample_var['sample_key2'] | default('sample_default') }}" sample_var: sample_key: "sample_value" > EOF root@5f208e7062e4:/tmp/tmp.hdaDLZqsNa# cat >template.txt < # Sample template {{ template_opts }} > EOF root@5f208e7062e4:/tmp/tmp.hdaDLZqsNa# ansible-playbook playbook.yaml [WARNING]: No inventory was parsed, only implicit localhost is available [WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all' PLAY [Sample playbook] *********************************************************************************************************************************************************************************** TASK [Gathering Facts] *********************************************************************************************************************************************************************************** ok: [localhost] TASK [Debug print success] ******************************************************************************************************************************************************************************* ok: [localhost] => { "msg": "# Sample template\nsample_value\n" } TASK [Debug print failure] ******************************************************************************************************************************************************************************* ok: [localhost] => { "msg": "# Sample template\nsample_default\n" } PLAY RECAP *********************************************************************************************************************************************************************************************** localhost : ok=3 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0