Skip to content

Interface Management throught 'enabled' and 'disabled' and not 'present'/'absent' #258

Open
@marcpaulchand

Description

@marcpaulchand
SUMMARY

So i've been trying to add an interface to a zone with this task

- name: Add default interface to public
  ansible.posix.firewalld:
    zone: public
    interface: "{{ ansible_default_ipv4.interface }}"
    state: present
    permanent: yes
    immediate: yes
  become: true

After some running and running i was still getting this unsuccessfull message

FAILED! => {"changed": false, "msg": "absent and present state can only be used in zone level operations"}

Refering the documentation, i should use the absentor present statement.

= state
        Enable or disable a setting.
        For ports: Should this port accept (enabled) or reject (disabled) connections.
        The states `present' and `absent' can only be used in zone level operations (i.e. when no other parameters but zone and state are set).
        (Choices: absent, disabled, enabled, present)
        type: str

After looking at #75

I change my playbook for enabled and it pass !

So does present and absent still mean something ?
Should the documentation be corrected ?

ISSUE TYPE
  • Documentation Report
COMPONENT NAME

firewalld.py

ANSIBLE VERSION
ansible 2.9.25
  python version = 3.9.6 (default, Jul 16 2021, 00:00:00) [GCC 11.1.1 20210531 (Red Hat 11.1.1-3)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue/PR relates to a bug.docsThe issue/pr is related to Documentationfirewalldsynchronize Issue and PR for firewalld moduleverifiedThis issue has been verified/reproduced by maintainerwaiting_on_contributorNeeds help. Feel free to engage to get things unblocked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions