Why Nostr? What is Njump?
2024-06-21 15:22:57

Anton on Nostr: Fun with Ansible. `defaults/main.yml`: docker_mtu: "{{ ansible_default_ipv6.mtu | ...

Fun with Ansible.
`defaults/main.yml`:
docker_mtu: "{{ ansible_default_ipv6.mtu | default(1450) | int }}"

To use this variable in another default variable, it always ends up as a string. Which the docker daemon does not really like.

Result? Let python/jinja2 handle it in the template:

{{ dict(docker_daemon_config, **{"mtu": docker_mtu|int }) | to_nice_json }}

Does someone have a better solution so the MTU is actually written out as an integer?

#ansible #jinja2 #python
Author Public Key
npub12nnrdgd46tr9r2hgf8ru2n2hlpcxl6mylsf3hlzpna6jl3qr07vqv2a5p8