# STDOUT: ---v---v---v---v---v--- Using /etc/ansible/ansible.cfg as config file PLAY [Ensure that the roles runs with default parameters] ********************** TASK [Gathering Facts] ********************************************************* ok: [sut] TASK [linux-system-roles.firewall : include_tasks] ***************************** included: /WORKDIR/dist-git-firewall-richm-restore_defaults-remove-and-compare-in-role-tccjQ6/tests/roles/linux-system-roles.firewall/tasks/firewalld.yml for sut TASK [linux-system-roles.firewall : Ensure ansible_facts used by role] ********* ok: [sut] TASK [linux-system-roles.firewall : Install firewalld] ************************* ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [linux-system-roles.firewall : Install python-firewall] ******************* skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [linux-system-roles.firewall : Install python3-firewall] ****************** ok: [sut] => { "changed": false, "rc": 0, "results": [] } MSG: Nothing to do TASK [linux-system-roles.firewall : Enable and start firewalld service] ******** changed: [sut] => { "changed": true, "enabled": true, "name": "firewalld", "state": "started", "status": { "ActiveEnterTimestampMonotonic": "0", "ActiveExitTimestampMonotonic": "0", "ActiveState": "inactive", "After": "sysinit.target dbus.service dbus.socket system.slice basic.target polkit.service", "AllowIsolate": "no", "AllowedCPUs": "", "AllowedMemoryNodes": "", "AmbientCapabilities": "", "AssertResult": "no", "AssertTimestampMonotonic": "0", "Before": "network-pre.target shutdown.target", "BlockIOAccounting": "no", "BlockIOWeight": "[not set]", "BusName": "org.fedoraproject.FirewallD1", "CPUAccounting": "no", "CPUAffinity": "", "CPUAffinityFromNUMA": "no", "CPUQuotaPerSecUSec": "infinity", "CPUQuotaPeriodUSec": "infinity", "CPUSchedulingPolicy": "0", "CPUSchedulingPriority": "0", "CPUSchedulingResetOnFork": "no", "CPUShares": "[not set]", "CPUUsageNSec": "[not set]", "CPUWeight": "[not set]", "CacheDirectoryMode": "0755", "CanFreeze": "yes", "CanIsolate": "no", "CanReload": "yes", "CanStart": "yes", "CanStop": "yes", "CapabilityBoundingSet": "cap_chown cap_dac_override cap_dac_read_search cap_fowner cap_fsetid cap_kill cap_setgid cap_setuid cap_setpcap cap_linux_immutable cap_net_bind_service cap_net_broadcast cap_net_admin cap_net_raw cap_ipc_lock cap_ipc_owner cap_sys_module cap_sys_rawio cap_sys_chroot cap_sys_ptrace cap_sys_pacct cap_sys_admin cap_sys_boot cap_sys_nice cap_sys_resource cap_sys_time cap_sys_tty_config cap_mknod cap_lease cap_audit_write cap_audit_control cap_setfcap cap_mac_override cap_mac_admin cap_syslog cap_wake_alarm cap_block_suspend cap_audit_read cap_perfmon cap_bpf", "CollectMode": "inactive", "ConditionResult": "no", "ConditionTimestampMonotonic": "0", "ConfigurationDirectoryMode": "0755", "Conflicts": "ebtables.service iptables.service ip6tables.service nftables.service ipset.service shutdown.target", "ControlPID": "0", "DefaultDependencies": "yes", "DefaultMemoryLow": "0", "DefaultMemoryMin": "0", "Delegate": "no", "Description": "firewalld - dynamic firewall daemon", "DevicePolicy": "auto", "Documentation": "man:firewalld(1)", "DynamicUser": "no", "EffectiveCPUs": "", "EffectiveMemoryNodes": "", "EnvironmentFiles": "/etc/sysconfig/firewalld (ignore_errors=yes)", "ExecMainCode": "0", "ExecMainExitTimestampMonotonic": "0", "ExecMainPID": "0", "ExecMainStartTimestampMonotonic": "0", "ExecMainStatus": "0", "ExecReload": "{ path=/bin/kill ; argv[]=/bin/kill -HUP $MAINPID ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "ExecStart": "{ path=/usr/sbin/firewalld ; argv[]=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }", "FailureAction": "none", "FileDescriptorStoreMax": "0", "FragmentPath": "/usr/lib/systemd/system/firewalld.service", "FreezerState": "running", "GID": "[not set]", "GuessMainPID": "yes", "IOAccounting": "no", "IOSchedulingClass": "0", "IOSchedulingPriority": "0", "IOWeight": "[not set]", "IPAccounting": "no", "IPEgressBytes": "18446744073709551615", "IPEgressPackets": "18446744073709551615", "IPIngressBytes": "18446744073709551615", "IPIngressPackets": "18446744073709551615", "Id": "firewalld.service", "IgnoreOnIsolate": "no", "IgnoreSIGPIPE": "yes", "InactiveEnterTimestampMonotonic": "0", "InactiveExitTimestampMonotonic": "0", "JobRunningTimeoutUSec": "infinity", "JobTimeoutAction": "none", "JobTimeoutUSec": "infinity", "KeyringMode": "private", "KillMode": "mixed", "KillSignal": "15", "LimitAS": "infinity", "LimitASSoft": "infinity", "LimitCORE": "infinity", "LimitCORESoft": "0", "LimitCPU": "infinity", "LimitCPUSoft": "infinity", "LimitDATA": "infinity", "LimitDATASoft": "infinity", "LimitFSIZE": "infinity", "LimitFSIZESoft": "infinity", "LimitLOCKS": "infinity", "LimitLOCKSSoft": "infinity", "LimitMEMLOCK": "65536", "LimitMEMLOCKSoft": "65536", "LimitMSGQUEUE": "819200", "LimitMSGQUEUESoft": "819200", "LimitNICE": "0", "LimitNICESoft": "0", "LimitNOFILE": "262144", "LimitNOFILESoft": "1024", "LimitNPROC": "14166", "LimitNPROCSoft": "14166", "LimitRSS": "infinity", "LimitRSSSoft": "infinity", "LimitRTPRIO": "0", "LimitRTPRIOSoft": "0", "LimitRTTIME": "infinity", "LimitRTTIMESoft": "infinity", "LimitSIGPENDING": "14166", "LimitSIGPENDINGSoft": "14166", "LimitSTACK": "infinity", "LimitSTACKSoft": "8388608", "LoadState": "loaded", "LockPersonality": "no", "LogLevelMax": "-1", "LogRateLimitBurst": "0", "LogRateLimitIntervalUSec": "0", "LogsDirectoryMode": "0755", "MainPID": "0", "MemoryAccounting": "yes", "MemoryCurrent": "[not set]", "MemoryDenyWriteExecute": "no", "MemoryHigh": "infinity", "MemoryLimit": "infinity", "MemoryLow": "0", "MemoryMax": "infinity", "MemoryMin": "0", "MemorySwapMax": "infinity", "MountAPIVFS": "no", "MountFlags": "", "NFileDescriptorStore": "0", "NRestarts": "0", "NUMAMask": "", "NUMAPolicy": "n/a", "Names": "firewalld.service", "NeedDaemonReload": "no", "Nice": "0", "NoNewPrivileges": "no", "NonBlocking": "no", "NotifyAccess": "none", "OOMScoreAdjust": "0", "OnFailureJobMode": "replace", "PermissionsStartOnly": "no", "Perpetual": "no", "PrivateDevices": "no", "PrivateMounts": "no", "PrivateNetwork": "no", "PrivateTmp": "no", "PrivateUsers": "no", "ProtectControlGroups": "no", "ProtectHome": "no", "ProtectKernelModules": "no", "ProtectKernelTunables": "no", "ProtectSystem": "no", "RefuseManualStart": "no", "RefuseManualStop": "no", "RemainAfterExit": "no", "RemoveIPC": "no", "Requires": "system.slice sysinit.target dbus.socket", "Restart": "no", "RestartUSec": "100ms", "RestrictNamespaces": "no", "RestrictRealtime": "no", "RestrictSUIDSGID": "no", "Result": "success", "RootDirectoryStartOnly": "no", "RuntimeDirectoryMode": "0755", "RuntimeDirectoryPreserve": "no", "RuntimeMaxUSec": "infinity", "SameProcessGroup": "no", "SecureBits": "0", "SendSIGHUP": "no", "SendSIGKILL": "yes", "Slice": "system.slice", "StandardError": "null", "StandardInput": "null", "StandardInputData": "", "StandardOutput": "null", "StartLimitAction": "none", "StartLimitBurst": "5", "StartLimitIntervalUSec": "10s", "StartupBlockIOWeight": "[not set]", "StartupCPUShares": "[not set]", "StartupCPUWeight": "[not set]", "StartupIOWeight": "[not set]", "StateChangeTimestampMonotonic": "0", "StateDirectoryMode": "0755", "StatusErrno": "0", "StopWhenUnneeded": "no", "SubState": "dead", "SuccessAction": "none", "SyslogFacility": "3", "SyslogLevel": "6", "SyslogLevelPrefix": "yes", "SyslogPriority": "30", "SystemCallErrorNumber": "0", "TTYReset": "no", "TTYVHangup": "no", "TTYVTDisallocate": "no", "TasksAccounting": "yes", "TasksCurrent": "[not set]", "TasksMax": "22665", "TimeoutStartUSec": "1min 30s", "TimeoutStopUSec": "1min 30s", "TimerSlackNSec": "50000", "Transient": "no", "Type": "dbus", "UID": "[not set]", "UMask": "0022", "UnitFilePreset": "enabled", "UnitFileState": "disabled", "UtmpMode": "init", "Wants": "network-pre.target", "WatchdogTimestampMonotonic": "0", "WatchdogUSec": "0" } } TASK [linux-system-roles.firewall : Check if previous replaced is defined] ***** ok: [sut] => { "ansible_facts": { "__firewall_previous_replaced": false, "__firewall_python_cmd": "/usr/bin/python3" }, "changed": false } TASK [linux-system-roles.firewall : Get config files, checksums before and remove] *** skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [linux-system-roles.firewall : Configure firewall] ************************ TASK [linux-system-roles.firewall : Get config files, checksums after] ********* skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [linux-system-roles.firewall : Calculate what has changed] **************** skipping: [sut] => { "changed": false, "skip_reason": "Conditional result was False" } TASK [linux-system-roles.firewall : Show diffs] ******************************** skipping: [sut] => {} TASK [Remove custom zone] ****************************************************** changed: [sut] => { "changed": true, "cmd": [ "firewall-cmd", "--permanent", "--delete-zone=custom" ], "delta": "0:00:00.634264", "end": "2022-05-03 11:25:17.522319", "failed_when_result": false, "rc": 112, "start": "2022-05-03 11:25:16.888055" } STDERR: Error: INVALID_ZONE: custom MSG: non-zero return code TASK [Reset internal zone to defaults] ***************************************** changed: [sut] => { "changed": true, "cmd": [ "firewall-cmd", "--permanent", "--load-zone-defaults=internal" ], "delta": "0:00:00.401996", "end": "2022-05-03 11:25:18.160652", "failed_when_result": false, "rc": 22, "start": "2022-05-03 11:25:17.758656" } STDERR: Error: NO_DEFAULTS: internal MSG: non-zero return code TASK [Reset trusted zone to defaults] ****************************************** changed: [sut] => { "changed": true, "cmd": [ "firewall-cmd", "--permanent", "--load-zone-defaults=trusted" ], "delta": "0:00:01.402232", "end": "2022-05-03 11:25:19.801550", "failed_when_result": false, "rc": 22, "start": "2022-05-03 11:25:18.399318" } STDERR: Error: NO_DEFAULTS: trusted MSG: non-zero return code TASK [Reset dmz zone to defaults] ********************************************** changed: [sut] => { "changed": true, "cmd": [ "firewall-cmd", "--permanent", "--load-zone-defaults=dmz" ], "delta": "0:00:01.396585", "end": "2022-05-03 11:25:21.438759", "failed_when_result": false, "rc": 22, "start": "2022-05-03 11:25:20.042174" } STDERR: Error: NO_DEFAULTS: dmz MSG: non-zero return code TASK [Reset drop zone to defaults] ********************************************* changed: [sut] => { "changed": true, "cmd": [ "firewall-cmd", "--permanent", "--load-zone-defaults=drop" ], "delta": "0:00:00.398787", "end": "2022-05-03 11:25:22.073092", "failed_when_result": false, "rc": 22, "start": "2022-05-03 11:25:21.674305" } STDERR: Error: NO_DEFAULTS: drop MSG: non-zero return code TASK [Reset public zone to defaults] ******************************************* changed: [sut] => { "changed": true, "cmd": [ "firewall-cmd", "--permanent", "--load-zone-defaults=public" ], "delta": "0:00:00.395591", "end": "2022-05-03 11:25:22.706184", "failed_when_result": false, "rc": 0, "start": "2022-05-03 11:25:22.310593" } STDOUT: success TASK [Reset default zone to defaults] ****************************************** changed: [sut] => { "changed": true, "cmd": "zone=$(firewall-cmd --get-default-zone)\nfirewall-cmd --permanent --load-zone-defaults=$zone\n", "delta": "0:00:00.794239", "end": "2022-05-03 11:25:23.739291", "failed_when_result": false, "rc": 22, "start": "2022-05-03 11:25:22.945052" } STDERR: Error: NO_DEFAULTS: public MSG: non-zero return code TASK [Create custom zone] ****************************************************** changed: [sut] => { "changed": true, "cmd": [ "firewall-cmd", "--permanent", "--new-zone=custom" ], "delta": "0:00:00.389073", "end": "2022-05-03 11:25:24.365785", "failed_when_result": false, "rc": 0, "start": "2022-05-03 11:25:23.976712" } STDOUT: success TASK [Reload firewalld] ******************************************************** changed: [sut] => { "changed": true, "cmd": [ "firewall-cmd", "--reload" ], "delta": "0:00:00.887995", "end": "2022-05-03 11:25:25.490205", "failed_when_result": false, "rc": 0, "start": "2022-05-03 11:25:24.602210" } STDOUT: success TASK [Permit traffic in default zone for https service] ************************ changed: [sut] => { "__firewall_changed": true, "changed": true, "failed_when_result": false } TASK [Permit traffic in default zone for https service, again] ***************** ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Permit traffic in default zone on port 8081/tcp] ************************* changed: [sut] => { "__firewall_changed": true, "changed": true, "failed_when_result": false } TASK [Permit traffic in default zone on port 8081/tcp, again] ****************** ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Allow port 161-162/udp in permanent default zone] ************************ changed: [sut] => { "__firewall_changed": true, "changed": true, "failed_when_result": false } TASK [Allow port 161-162/udp in permanent default zone, again] ***************** ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Do not permit traffic in default zone on port 8081/tcp] ****************** changed: [sut] => { "__firewall_changed": true, "changed": true, "failed_when_result": false } TASK [Do not permit traffic in default zone on port 8081/tcp, again] *********** ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Allow service http in permanent dmz zone] ******************************** changed: [sut] => { "__firewall_changed": true, "changed": true, "failed_when_result": false } TASK [Allow service http in permanent dmz zone, again] ************************* ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Allow service ftp with limitation using rich rule in permanent default zone] *** changed: [sut] => { "__firewall_changed": true, "changed": true, "failed_when_result": false } TASK [Allow service ftp with limitation using rich rule in permanent default zone, again] *** ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Allow source 192.0.2.0/24 in internal zone] ****************************** changed: [sut] => { "__firewall_changed": true, "changed": true, "failed_when_result": false } TASK [Allow source 192.0.2.0/24 in internal zone, again] *********************** ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Allow interface eth2 in permanent trusted zone] ************************** changed: [sut] => { "__firewall_changed": true, "changed": true, "failed_when_result": false } TASK [Allow interface eth2 in permanent trusted zone, again] ******************* ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Allow masquerading in permament dmz zone] ******************************** changed: [sut] => { "__firewall_changed": true, "changed": true, "failed_when_result": false } TASK [Allow masquerading in permament dmz zone, again] ************************* ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Ensure permanent custom zone exists (no change)] ************************* ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Ensure ICMP block inversion in permanent drop zone] ********************** changed: [sut] => { "__firewall_changed": true, "changed": true, "failed_when_result": false } TASK [Ensure ICMP block inversion in permanent drop zone, again] *************** ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Block ICMP echo-request in permanent drop zone] ************************** changed: [sut] => { "__firewall_changed": true, "changed": true, "failed_when_result": false } TASK [Block ICMP echo-request in permanent drop zone, again] ******************* ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Ensure default target in permanent internal zone (no change)] ************ ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Ensure target ACCEPT in permanent internal zone] ************************* changed: [sut] => { "__firewall_changed": true, "changed": true, "failed_when_result": false } TASK [Ensure target ACCEPT in permanent internal zone, again] ****************** ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Ensure default target in permanent internal zone] ************************ changed: [sut] => { "__firewall_changed": true, "changed": true, "failed_when_result": false } TASK [Ensure default target in permanent internal zone, again] ***************** ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Redirect port 443 to 8443 with Rich Rule in permanent and runtime public zone] *** changed: [sut] => { "__firewall_changed": true, "changed": true, "failed_when_result": false } TASK [Redirect port 443 to 8443 with Rich Rule in permanent and runtime public zone, again] *** ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Firewalld custom zone] *************************************************** changed: [sut] => { "__firewall_changed": true, "changed": true } TASK [assert firewalld custom zone] ******************************************** ok: [sut] => { "changed": false } MSG: All assertions passed TASK [Add masquerade to custom zone] ******************************************* changed: [sut] => { "__firewall_changed": true, "changed": true, "failed_when_result": false } TASK [Add masquerade to custom zone, again] ************************************ ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [set default zone] ******************************************************** changed: [sut] => { "__firewall_changed": true, "changed": true, "failed_when_result": false } TASK [set default zone, again] ************************************************* ok: [sut] => { "__firewall_changed": false, "changed": false, "failed_when_result": false } TASK [Remove custom zone] ****************************************************** changed: [sut] => { "changed": true, "cmd": [ "firewall-cmd", "--permanent", "--delete-zone=custom" ], "delta": "0:00:00.395689", "end": "2022-05-03 11:25:46.637639", "failed_when_result": false, "rc": 0, "start": "2022-05-03 11:25:46.241950" } STDOUT: success TASK [Reset internal zone to defaults] ***************************************** changed: [sut] => { "changed": true, "cmd": [ "firewall-cmd", "--permanent", "--load-zone-defaults=internal" ], "delta": "0:00:01.404948", "end": "2022-05-03 11:25:48.279308", "failed_when_result": false, "rc": 0, "start": "2022-05-03 11:25:46.874360" } STDOUT: success TASK [Reset trusted zone to defaults] ****************************************** changed: [sut] => { "changed": true, "cmd": [ "firewall-cmd", "--permanent", "--load-zone-defaults=trusted" ], "delta": "0:00:00.396941", "end": "2022-05-03 11:25:48.921614", "failed_when_result": false, "rc": 0, "start": "2022-05-03 11:25:48.524673" } STDOUT: success TASK [Reset dmz zone to defaults] ********************************************** changed: [sut] => { "changed": true, "cmd": [ "firewall-cmd", "--permanent", "--load-zone-defaults=dmz" ], "delta": "0:00:00.395221", "end": "2022-05-03 11:25:49.565428", "failed_when_result": false, "rc": 0, "start": "2022-05-03 11:25:49.170207" } STDOUT: success TASK [Reset drop zone to defaults] ********************************************* changed: [sut] => { "changed": true, "cmd": [ "firewall-cmd", "--permanent", "--load-zone-defaults=drop" ], "delta": "0:00:00.395379", "end": "2022-05-03 11:25:50.198720", "failed_when_result": false, "rc": 0, "start": "2022-05-03 11:25:49.803341" } STDOUT: success TASK [Reset public zone to defaults] ******************************************* changed: [sut] => { "changed": true, "cmd": [ "firewall-cmd", "--permanent", "--load-zone-defaults=public" ], "delta": "0:00:00.394134", "end": "2022-05-03 11:25:50.841837", "failed_when_result": false, "rc": 0, "start": "2022-05-03 11:25:50.447703" } STDOUT: success TASK [Reset default zone to defaults] ****************************************** changed: [sut] => { "changed": true, "cmd": "firewall-cmd --permanent --load-zone-defaults=public\n", "delta": "0:00:00.397365", "end": "2022-05-03 11:25:51.474263", "failed_when_result": false, "rc": 22, "start": "2022-05-03 11:25:51.076898" } STDERR: Error: NO_DEFAULTS: public MSG: non-zero return code TASK [Reload firewalld] ******************************************************** changed: [sut] => { "changed": true, "cmd": [ "firewall-cmd", "--reload" ], "delta": "0:00:00.899335", "end": "2022-05-03 11:25:52.618385", "failed_when_result": false, "rc": 0, "start": "2022-05-03 11:25:51.719050" } STDOUT: success PLAY RECAP ********************************************************************* sut : ok=60 changed=35 unreachable=0 failed=0 skipped=6 rescued=0 ignored=0 ---^---^---^---^---^--- # STDERR: ---v---v---v---v---v--- [DEPRECATION WARNING]: Alias 'immediate' is deprecated. See the module docs for more information. This feature will be removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. ---^---^---^---^---^---