• [Epic]: bug in toml rendering of `podman_containers_conf`
    • Low
    • Red Hat Enterprise Linux
    • 50% To Do, 25% In Progress, 25% Done
    • rhel-sst-system-roles
    • False
    • Hide

      None

      Show
      None
    • Yes
    • Dev ack
    • Bug Fix
    • Unspecified
    • Unspecified
    • Unspecified

      Controller Ansible: 2.18.3
      Controller Python: 3.12.9
      Controller OS: macos

      Host Python: 3.9
      Host OS: RHEL 9.5

      Collection version: latest off ansible galaxy

      Podman running rootless

      Hello, I'm trying to apply the following configuration:

      ```yaml
      podman_containers_conf:
      containers:
      container_name_as_hostname: true
      log_driver: journald
      mounts: []
      tz: "{{ ansible_date_time.tz }}"
      engine:
      events_logger: journald
      healthcheck_events: false
      pull_policy: missing
      network:
      default_rootless_network_cmd: pasta
      network_backend: netavark
      ```

      I would expect to get output like

      ```toml
      #

      1. Ansible managed
        #
      2. system_role:podman

      [containers]
      container_name_as_hostname=true
      log_driver="journald"
      mounts=[]
      tz="CET"
      [engine]
      events_logger="journald"
      healthcheck_events=false
      pull_policy="missing"
      [network]
      default_rootless_network_cmd="pasta"
      network_backend="netavark"
      ```

      but instead i'm getting output of

      ```toml
      #

      1. Ansible managed
        #
      2. system_role:podman

      [containers]
      container_name_as_hostname = True
      log_driver="journald"
      mounts=[]
      tz="CET"
      [engine]
      events_logger="journald"
      healthcheck_events = False
      pull_policy="missing"
      [network]
      default_rootless_network_cmd="pasta"
      network_backend="netavark"
      ```

      which causes the following error:

      ```
      Mar 10 09:43:05 hostname systemd[15782]: 755dd2504963d286f699e262fe93cb49f8d6a95a522e01a8c87099b9a8f30820-4440e4c1d9912144.service: Failed with result 'exit-code'.
      Mar 10 09:43:06 hostname python3.9[150086]: ansible-systemd Invoked with name=podman-user-wait-network-online.service state=started scope=user daemon_reload=False daemon_reexec=False no_block=False enabled=None force=None masked=None
      Mar 10 09:43:12 hostname podman[150148]: time="2025-03-10T09:43:12+01:00" level=error msg="reading system config \"/home/podman/.config/containers/containers.conf.d/50-systemroles.conf\": decode configuration /home/podman/.config/containers/containers.conf.d/50-systemroles.conf: toml: line 7 (last key \"containers.container_name_as_hostname\"): expected value but found \"True\" instead"
      Mar 10 09:43:12 hostname systemd[15782]: 9f0e45aa2512750e3a1179221146cc79fb396699e430c59d6f0ac8d1632ccb8a-601bc5ac3b283d4f.service: Main process exited, code=exited, status=1/FAILURE
      ```

      It seems to be something in the Jinja2 template, i took a look at it but I'm not very familiar with Jinja. It seems like the bool isn't being converted properly?

              rmeggins@redhat.com Richard Megginson
              rmeggins@redhat.com Richard Megginson
              Richard Megginson Richard Megginson
              David Jez David Jez
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: