Hi
I have issues with dict2items
. It fails on my proxmox ubuntu VMs.
The test playbook I use is following:
- name: Test loop with lists
hosts: localhost
gather_facts: no
vars:
test:
test_key_1:
- list_item_1
- list_item_2
- list_item_3
test_key_2:
- list_item_1
- list_item_2
- list_item_3
tasks:
- name: Show test_items
ansible.builtin.debug:
msg: "{{ test | dict2items }}"
Ansible only gives following output:
ansible-playbook test2.yml
PLAY [Test loop with lists] ***************************************************************************************************************************************************
TASK [Show test_items] ********************************************************************************************************************************************************
usage: ansible-playbook [-h] NEW OLD OLD_VER OUTPUT
ansible-playbook: error: the following arguments are required: OLD, OLD_VER, OUTPUT
ERROR! A worker was found in a dead state
I also tested it on a VPS which also has ubuntu installed and there it’s working fine.
Output of ansible on VPS:
ansible-playbook test.yml
PLAY [Test loop with lists] ***************************************************************************************************************************************************
TASK [Show test_items] ********************************************************************************************************************************************************
ok: [localhost] => {
"msg": [
{
"key": "test_key_1",
"value": [
"list_item_1",
"list_item_2",
"list_item_3"
]
},
{
"key": "test_key_2",
"value": [
"list_item_1",
"list_item_2",
"list_item_3"
]
}
]
}
PLAY RECAP ********************************************************************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
The python interpreter and ansible is everywhere the same:
ansible --version
ansible [core 2.18.1]
config file = /opt/test/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /opt/test/venv/lib/python3.12/site-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /opt/test/venv/bin/ansible
python version = 3.12.3 (main, Jan 17 2025, 18:03:48) [GCC 13.3.0] (/opt/test/venv/bin/python3)
jinja version = 3.1.4
libyaml = True
DMESG and journalctl is also showing no related errors.
Has someone an idea what’s going on or can help me debug the issue further?