Ansible.builtin.async_status throwing error in Ansible 2.19

While executing the following task, an error is observed:

- name: Wait for instance(s) creation to complete
  become: "{{ not item.item.rootless | default(omit) }}"
  ansible.builtin.async_status:
    jid: "{{ item.ansible_job_id }}"
  register: podman_jobs
  until: podman_jobs.finished
  retries: 300
  with_items: "{{ server.results }}"
  loop_control:
    label: "{{ item.item.name | default('Unnamed') }}"

Error:
“msg”: “Elements value for option ‘cmd_args’ is of type NoneType and we were unable to convert to str: ‘None’ is not a string and conversion is not allowed”,
“results_file”: “/root/.ansible_async/j843353491924.4157701”,
“started”: true,
“stderr”: “”,
“stderr_lines”: ,
“stdout”: “”,
“stdout_lines”:

Invocation:
{
“module_args”: {
“annotation”: null,
“arch”: null,
“attach”: null,
“authfile”: null,
“blkio_weight”: null,
“blkio_weight_device”: null,
“cap_add”: null,
“cap_drop”: null,
“cgroup_conf”: null,
“cgroup_parent”: null,
“cgroupns”: null,
“cgroups”: null,
“chrootdirs”: null,
“cidfile”: null,
“cmd_args”: ,
“command”: “/sbin/init”,
“conmon_pidfile”: null,
“cpu_period”: null,
“cpu_quota”: null,
“cpu_rt_period”: null,
“cpu_rt_runtime”: null,
“cpu_shares”: null,
“cpus”: null,
“cpuset_cpus”: null,
“cpuset_mems”: null,
“debug”: false,
“decryption_key”: null,
“delete_depend”: null,
“delete_time”: null,
“delete_volumes”: null,
“detach”: true,
“detach_keys”: null,
“device”: null,
“device_cgroup_rule”: null,
“device_read_bps”: null,
“device_read_iops”: null,
“device_write_bps”: null,
“device_write_iops”: null,
“dns”: null,
“dns_option”: null,
“dns_search”: null,
“entrypoint”: null,
“env”: null,
“env_file”: null,
“env_host”: null,
“env_merge”: null,
“etc_hosts”: null,
“executable”: “podman”,
“expose”: null,
“force_delete”: true,
“force_restart”: false,
“generate_systemd”: {},
“gidmap”: null,
“gpus”: null,
“group_add”: null,
“group_entry”: null,
“health_startup_cmd”: null,
“health_startup_interval”: null,
“health_startup_retries”: null,
“health_startup_success”: null,
“health_startup_timeout”: null,
“healthcheck”: null,
“healthcheck_failure_action”: null,
“healthcheck_interval”: null,
“healthcheck_retries”: null,
“healthcheck_start_period”: null,
“healthcheck_timeout”: null,
“hooks_dir”: null,
“hostname”: “centos”,
“hostuser”: null,
“http_proxy”: null,
“image”: “molecule_local/quay.io/centos/centos:stream10”,
“image_strict”: false,
“image_volume”: null,
“init”: null,
“init_ctr”: null,
“init_path”: null,
“interactive”: null,
“ip”: null,
“ip6”: null,
“ipc”: null,
“kernel_memory”: null,
“label”: {
“owner”: “molecule”
},
“label_file”: null,
“log_driver”: null,
“log_level”: null,
“log_opt”: null,
“mac_address”: null,
“memory”: null,
“memory_reservation”: null,
“memory_swap”: null,
“memory_swappiness”: null,
“mount”: null,
“name”: “centos”,
“network”: null,
“network_aliases”: null,
“no_healthcheck”: null,
“no_hosts”: null,
“oom_kill_disable”: null,
“oom_score_adj”: null,
“os”: null,
“passwd”: null,
“passwd_entry”: null,
“personality”: null,
“pid”: null,
“pid_file”: null,
“pids_limit”: null,
“platform”: null,
“pod”: null,
“pod_id_file”: null,
“preserve_fd”: null,
“preserve_fds”: null,
“privileged”: true,
“publish”: null,
“publish_all”: null,
“pull”: null,
“quadlet_dir”: null,
“quadlet_file_mode”: null,
“quadlet_filename”: null,
“quadlet_options”: null,
“rdt_class”: null,
“read_only”: null,
“read_only_tmpfs”: null,
“recreate”: false,
“requires”: null,
“restart_policy”: null,
“restart_time”: null,
“retry”: null,
“retry_delay”: null,
“rm”: null,
“rmi”: null,
“rootfs”: null,
“sdnotify”: null,
“seccomp_policy”: null,
“secrets”: null,
“security_opt”: null,
“shm_size”: null,
“shm_size_systemd”: null,
“sig_proxy”: null,
“state”: “started”,
“stop_signal”: null,
“stop_time”: null,
“stop_timeout”: null,
“subgidname”: null,
“subuidname”: null,
“sysctl”: null,
“systemd”: null,
“timeout”: null,
“timezone”: null,
“tls_verify”: null,
“tmpfs”: null,
“tty”: null,
“uidmap”: null,
“ulimit”: null,
“umask”: null,
“unsetenv”: null,
“unsetenv_all”: null,
“user”: null,
“userns”: null,
“uts”: null,
“variant”: null,
“volume”: [
“/tmp:/tmp”
],
“volumes_from”: null,
“workdir”: null
}
}

This task is part of the podman molecule plugin.

How can this be fixed?

@Core ^ (some random text to reach 20 letters…)

I’m only able to reproduce that error by passing a list containing None to the argument cmd_args. But this fails on 2.18, as well as 2.19, so I think I’m missing important details. Here’s my reproducer:

- hosts: localhost
  gather_facts: no
  tasks:
    - containers.podman.podman_container:
        image: quay.io/centos/centos:stream10
        name: centos
        cmd_args:
          - ~
      async: 45
      poll: 0
      register: async_result

    - async_status:  # fails with the same error as shown
        jid: "{{ async_result.ansible_job_id }}"
      register: job_result
      until: job_result.finished
      retries: 5
      delay: 10

If cmd_args is not passed (as mentioned in the playbook task), it is an empty list, which is throwing an error in 2.19 but not in 2.18.

I am using the molecule podman plugin to execute molecule testcases for roles.

Following is the repository and the command I have used.

repository: GitHub - dell/dellemc-openmanage-ansible-modules: Dell OpenManage Ansible Modules

The following command is part of the idrac_gatherfacts role.
molecule -vvvv -e /root/.env.yml --base-config ../molecule.yml test -s backplane-10633

I had installed molecule and molecule-plugins[podman] for this execution.

Am I missing something here?