# ansible error

**URL:** <https://forum.ansible.com/t/ansible-error/34472>\
**Category:** Ansible Project\
**Created:** [January 19, 2021, 8:15pm UTC](https://forum.ansible.com/t/ansible-error/34472 "2021-01-19T20:15:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Meyer1](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@Andrew\_Meyer1](https://forum.ansible.com/u/Andrew_Meyer1)\
**Post date:** [January 19, 2021, 8:15pm UTC](https://forum.ansible.com/t/ansible-error/34472/1 "2021-01-19T20:15:58Z")

</div>

Hello,  
I am trying to run my ansible playbook but am getting the following error running ansible

```auto

ansible-2.9.16-1.el8.noarch
ansible-doc-2.9.16-1.el8.noarch
ansible-freeipa-0.1.12-6.el8.noarch

```

```auto

The full traceback is:
Traceback (most recent call last):
File "/home/ameyer/.ansible/tmp/ansible-tmp-1611086687.8022811-260421839119082/AnsiballZ_firewalld.py", line 102, in <module>
_ansiballz_main()
File "/home/ameyer/.ansible/tmp/ansible-tmp-1611086687.8022811-260421839119082/AnsiballZ_firewalld.py", line 94, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/ameyer/.ansible/tmp/ansible-tmp-1611086687.8022811-260421839119082/AnsiballZ_firewalld.py", line 40, in invoke_module
runpy.run_module(mod_name='ansible.modules.system.firewalld', init_globals=None, run_name=' __main__', alter_sys=True)
File "/usr/lib64/python3.6/runpy.py", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/lib64/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/usr/lib64/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/tmp/ansible_firewalld_payload_xaj8iemr/ansible_firewalld_payload.zip/ansible/modules/system/firewalld.py", line 871, in <module>
File "/tmp/ansible_firewalld_payload_xaj8iemr/ansible_firewalld_payload.zip/ansible/modules/system/firewalld.py", line 686, in main
ValueError: too many values to unpack (expected 2)
fatal: [10.150.10.6]: FAILED! => {
"changed": false,
"module_stderr": "Shared connection to 10.150.10.6 closed.\r\n",
"module_stdout": "Traceback (most recent call last):\r\n File \"/home/ameyer/.ansible/tmp/ansible-tmp-1611086687.8022811-260421839119082/AnsiballZ_firewalld.py\", line 102, in <module>\r\n _ansiballz_main()\r\n File \"/home/ameyer/.ansible/tmp/ansible-tmp-1611086687.8022811-260421839119082/AnsiballZ_firewalld.py\", line 94, in _ansiballz_main\r\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n File \"/home/ameyer/.ansible/tmp/ansible-tmp-1611086687.8022811-260421839119082/AnsiballZ_firewalld.py\", line 40, in invoke_module\r\n runpy.run_module(mod_name='ansible.modules.system.firewalld', init_globals=None, run_name=' __main__', alter_sys=True)\r\n File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\r\n return _run_module_code(code, init_globals, run_name, mod_spec)\r\n File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\r\n mod_name, mod_spec, pkg_name, script_name)\r\n File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\r\n exec(code, run_globals)\r\n File \"/tmp/ansible_firewalld_payload_xaj8iemr/ansible_firewalld_payload.zip/ansible/modules/system/firewalld.py\", line 871, in <module>\r\n File \"/tmp/ansible_firewalld_payload_xaj8iemr/ansible_firewalld_payload.zip/ansible/modules/system/firewalld.py\", line 686, in main\r\nValueError: too many values to unpack (expected 2)\r\n",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}

```

---

<div class="post-metadata">

**Author:** ![Andrew\_Meyer1](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@Andrew\_Meyer1](https://forum.ansible.com/u/Andrew_Meyer1)\
**Post date:** [January 19, 2021, 8:17pm UTC](https://forum.ansible.com/t/ansible-error/34472/2 "2021-01-19T20:17:12Z")

</div>

Here is the section this is referring too:

# tasks file for setup\_dhcpd

- name: Update Firewall Rules dhcp01  
firewalld:  
port: “{{ ports\_dhcpd01 }}”  
permanent: true  
state: enabled  
immediate: yes  
zone: public  
become: true

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [January 19, 2021, 11:07pm UTC](https://forum.ansible.com/t/ansible-error/34472/3 "2021-01-19T23:07:43Z")

</div>

what does ports\_dhcpd01 evaluate to?

---

<div class="post-metadata">

**Author:** ![Andrew\_Meyer1](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@Andrew\_Meyer1](https://forum.ansible.com/u/Andrew_Meyer1)\
**Post date:** [January 22, 2021, 8:30pm UTC](https://forum.ansible.com/t/ansible-error/34472/4 "2021-01-22T20:30:00Z")

</div>



---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [January 23, 2021, 6:19am UTC](https://forum.ansible.com/t/ansible-error/34472/5 "2021-01-23T06:19:26Z")

</div>

That parameter is for ports or port ranges, but you try to use a single port with two different protocols.  
That does not seem to be supported:

[https://docs.ansible.com/ansible/latest/collections/ansible/posix/firewalld\_module.html#parameter-port](https://docs.ansible.com/ansible/latest/collections/ansible/posix/firewalld_module.html#parameter-port)

You should either rearrange the data structure of your vars, or if that is not possible add some split/loop logic around the task.

---

<div class="post-metadata">

**Author:** ![Andrew\_Meyer1](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@Andrew\_Meyer1](https://forum.ansible.com/u/Andrew_Meyer1)\
**Post date:** [January 23, 2021, 4:29pm UTC](https://forum.ansible.com/t/ansible-error/34472/6 "2021-01-23T16:29:11Z")

</div>

I changed it to an item loop. Fixed.

Thank you!

Andrew Meyer  
314-277-3307
