0

I am getting error while calling variable from vars files in tasks/main.yml of a role,

vars/main.yml looks like below,

ports:
  - "8080/tcp"
  - "80/tcp"

And in tasks/main.yml, calling like below,

- name: open firewall port
  firewalld:
    zone: public
    port: "{{ item }}"
    state: enabled
    permanent: yes
  loop:
    - "{{ ports }}"

Getting error like below

ain\r\nValueError: too many values to unpack\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}

But it's working fine if I provide ports directly instead of calling from vars

- name: open firewall port
  firewalld:
    zone: public
    port: "{{ item }}"
    state: enabled
    permanent: yes
  loop:
    - "8080/tcp"
    - "80/tcp"

TIA

user3132525
  • 123
  • 6

0 Answers0