-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #823 from openshift-cherrypick-robot/cherry-pick-8…
…00-to-18.0-fr1 [18.0-fr1] Add firewall rule to include Kepler port
- Loading branch information
Showing
6 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
roles/edpm_telemetry_power_monitoring/molecule/default/test-helpers/kepler.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
- name: kepler rule source file exists | ||
become: true | ||
ansible.builtin.stat: | ||
path: "/var/lib/edpm-config/firewall/kepler.yaml" | ||
register: kepler_rule_source_exists | ||
- name: Assert kepler rule source file exists | ||
ansible.builtin.assert: | ||
that: | ||
- kepler_rule_source_exists.stat.exists | ||
fail_msg: "kepler rule source file does not exist" | ||
|
||
- name: verify vnc nftables firewall rules | ||
block: | ||
- name: Run nft list command and grep for Kepler rule in EDPM_INPUT chain | ||
become: true | ||
ansible.builtin.shell: nft list table inet filter | awk '/chain EDPM_INPUT {/,/}/' | grep Kepler | ||
register: kepler_chain_exists | ||
- name: Assert that output from greping for VNC contains the correct rule | ||
assert: | ||
that: | ||
- item | regex_search('\s+tcp dport 8888 ct state new counter packets \d+ bytes \d+ accept comment\s+') | ||
loop: "{{ kepler_chain_exists.stdout_lines }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
roles/edpm_telemetry_power_monitoring/tasks/post-install.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
- name: Ensure firewall directory is present | ||
become: true | ||
ansible.builtin.file: | ||
path: "/var/lib/edpm-config/firewall/" | ||
state: directory | ||
owner: root | ||
group: root | ||
mode: '0750' | ||
|
||
- name: Copy kepler firewall config | ||
become: true | ||
ansible.builtin.template: | ||
src: "firewall.yaml.j2" | ||
dest: "/var/lib/edpm-config/firewall/kepler.yaml" | ||
mode: "0640" | ||
|
||
- name: Configure firewall for kepler | ||
ansible.builtin.include_role: | ||
name: osp.edpm.edpm_nftables | ||
tasks_from: "configure.yml" | ||
|
||
- name: Reload firewall for kepler | ||
ansible.builtin.include_role: | ||
name: osp.edpm.edpm_nftables | ||
tasks_from: "run.yml" |
7 changes: 7 additions & 0 deletions
7
roles/edpm_telemetry_power_monitoring/templates/firewall.yaml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
# Generated via edpm_telemetry_power_monitoring | ||
- rule_name: 000 Allow Kepler traffic | ||
rule: | ||
proto: tcp | ||
dport: | ||
- "8888" |