Bug 2222433

Summary: Check mode fails when creating new firewall service
Product: Red Hat Enterprise Linux 8 Reporter: Rich Megginson <rmeggins>
Component: rhel-system-rolesAssignee: Rich Megginson <rmeggins>
Status: VERIFIED --- QA Contact: David Jež <djez>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.9CC: djez, jharuda, rhel-cs-system-management-subsystem-qe, spetrosi, vdanek
Target Milestone: rcKeywords: Triaged
Target Release: 8.9Flags: rmeggins: needinfo? (vdanek)
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: role:firewall
Fixed In Version: rhel-system-roles-1.22.0-0.16.el8 Doc Type: Bug Fix
Doc Text:
Enhancement: - firewall_lib.py - check if service exists before running firewalld methods that would cause failure - fails if service does not exist and in diff mode, warns if in check mode and service does not exist - README.md - reflects changes and explains interaction with check mode - tests/tests_service.yml - add integration test case for adding non-existent services in check mode - tests/unit/test_firewall_lib.py - Mock necessary output from fw.config().getServiceNames() Reason: Better compliance with Ansible best practices for check mode (not failing in check mode, especially where they would not fail in diff mode) Reason for this particular solution - We cannot track changes from previous check modes without overhauling how check mode is handled throughout the entire system role. Result: Undefined services being enabled or disabled will not result in failure while in check mode, but a warning will be displayed intended to prompt the user to confirm that the service is defined in a previous play, since the same action could result in failure when run in diff mode. Issue Tracker Tickets (Jira or BZ if any): - Addresses GitHub Issue #146
Story Points: ---
Clone Of: 2222428 Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2222428    
Bug Blocks:    

Description Rich Megginson 2023-07-12 17:55:39 UTC
+++ This bug was initially created as a clone of Bug #2222428 +++

When creating and enabling a service, using check mode will fail since the service does not exist - should issue a warning that the service does not exist - see https://github.com/linux-system-roles/firewall/issues/146