USHIFT-6681: Ansible: Unmask and enable firewalld on host setup#6315
USHIFT-6681: Ansible: Unmask and enable firewalld on host setup#6315openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
Conversation
|
@sjug: This pull request references USHIFT-6681 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughUnconditional firewalld unmask/start is applied and firewall configuration tasks simplified to always apply public-zone service and port rules, removing previous masked-state checks and trusted-CIDR conditional branches. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@sjug: This pull request references USHIFT-6681 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@ansible/roles/setup-microshift-host/tasks/main.yml`:
- Around line 35-44: The unmask+enable systemd tasks ("unmask firewalld if
masked" and "start and enable firewalld") currently run unconditionally and can
override intentional masked state; make both ansible.builtin.systemd tasks
conditional by adding a boolean gate variable (e.g., firewalld_force_enable) and
a when: clause (use firewalld_force_enable | default(false) so CI can set true
while other environments keep the masked state), applying the same condition to
both the masked: no call and the state/enabled call so masking remains respected
unless explicitly forced.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 0ed6fcb5-98df-4b1b-8fee-480b6d884c3d
📒 Files selected for processing (1)
ansible/roles/setup-microshift-host/tasks/main.yml
- Remove dead masked-state handling
|
@sjug: This pull request references USHIFT-6681 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.22.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
ansible/roles/setup-microshift-host/tasks/main.yml (1)
35-44:⚠️ Potential issue | 🟠 MajorAdd an opt-in gate for force-enabling firewalld.
These tasks still unconditionally unmask and enable
firewalld, which can override an intentionally masked host policy. Please gate both tasks behind a boolean variable so CI can force-enable while other environments can opt out.Proposed patch
- name: unmask firewalld if masked ansible.builtin.systemd: name: firewalld masked: no + when: firewalld_force_enable | default(false) | bool - name: start and enable firewalld ansible.builtin.systemd: name: firewalld state: started enabled: yes + when: firewalld_force_enable | default(false) | bool🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ansible/roles/setup-microshift-host/tasks/main.yml` around lines 35 - 44, The unmask/start-and-enable tasks for firewalld ("unmask firewalld if masked" and "start and enable firewalld" using ansible.builtin.systemd) must be made opt-in; add a boolean gate (e.g., force_enable_firewalld) and add when: force_enable_firewalld | default(false) to both tasks so they only run when CI/consumer sets the variable, and add a default false for force_enable_firewalld in the role defaults to preserve current host policies unless explicitly overridden.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@ansible/roles/setup-microshift-host/tasks/main.yml`:
- Around line 35-44: The unmask/start-and-enable tasks for firewalld ("unmask
firewalld if masked" and "start and enable firewalld" using
ansible.builtin.systemd) must be made opt-in; add a boolean gate (e.g.,
force_enable_firewalld) and add when: force_enable_firewalld | default(false) to
both tasks so they only run when CI/consumer sets the variable, and add a
default false for force_enable_firewalld in the role defaults to preserve
current host policies unless explicitly overridden.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 879c7040-99bb-4de4-8b10-b915bc0eda10
📒 Files selected for processing (2)
ansible/roles/configure-firewall/tasks/main.ymlansible/roles/setup-microshift-host/tasks/main.yml
|
@sjug: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/verified by ci |
|
/lgtm |
|
@copejon: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: copejon, sjug The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Needed for CI compatibility
Summary by CodeRabbit