ansibleansible-awx

Ansible points to an error with a non-existent parameter in the iptables module


Playbook:

- name: Изменение правил iptables 
  hosts: server01
  tasks:
   - name: Добавление правила
     ansible.builtin.iptables:
        chain: INPUT
        protocol: tcp
        destination_port: 80
        ctstate: NEW
        jump: ACCEPT
        comment: Allow HTTP
     become: yes

Output:

fatal: [server01]: FAILED! => {"changed": false, "msg": "Unsupported parameters for (ansible.builtin.iptables) module: match_set_flagschain Supported parameters include:

I don't understand what the error is, this parmater is not in the playbook itself and it is not in the documentation

I tried to test the module and its behavior in the system


Solution

  • I don't understand what the error is ...

    Error messages like Unsupported parameters for (<moduleName>) module: <givenParameter>. Supported parameters include: <supportedParametersList> are usually syntax errors of the module used.

    ... this parameter is not in the playbook itself ...

    Not within the question posted, maybe somewhere else.

    ... it is not in the documentation ...

    The documentation of iptables module – Modify iptables rules show within the list of Parameters

    as well

    So the message Unsupported parameters for (ansible.builtin.iptables) module: match_set_flagschain still indicates an syntax error.

    Furthermore I wasn't able to reproduce an issue with a simple minimal playbook

    ---
    - hosts: localhost
      become: true
      gather_facts: false
    
      tasks:
    
      - ansible.builtin.iptables:
          chain: INPUT
          protocol: tcp
          destination_port: 80
          ctstate: NEW
          jump: ACCEPT
          comment: Allow HTTP