Skip to content

Commit

Permalink
fix: minor syntactical refinements from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
natoscott committed Aug 21, 2024
1 parent 18a5d58 commit 9f46acf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions tasks/firewall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
__metrics_firewall: "{{ __metrics_firewall |
union([{'port': '44322/tcp', 'state': 'enabled'}]) }}"
when:
- metrics_graph_service|bool or metrics_query_service|bool
- metrics_graph_service | bool or metrics_query_service|bool

- name: Service for grafana
set_fact:
Expand All @@ -35,15 +35,15 @@
__metrics_firewall: "{{ __metrics_firewall |
union([{'service': 'valkey', 'state': 'enabled'}]) }}"
when:
- metrics_query_service|bool
- metrics_query_service | bool
- ansible_facts['distribution_version'] is version('10', '>=')

- name: Service for redis
set_fact:
__metrics_firewall: "{{ __metrics_firewall |
union([{'service': 'redis', 'state': 'enabled'}]) }}"
when:
- metrics_query_service|bool
- metrics_query_service | bool
- ansible_facts['distribution_version'] is version('10', '<')

- name: Ensure the service and the port status with the firewall role
Expand Down
19 changes: 10 additions & 9 deletions tests/check_keyserver.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
# SPDX-License-Identifier: MIT
---
- name: Check if Redis responds
shell: |
set -euo pipefail
redis-cli PING | grep PONG
changed_when: false
when: (ansible_distribution in ['RedHat', 'CentOS'] and
ansible_distribution_major_version | int > 6 and
ansible_distribution_major_version | int < 10)

- name: Check if Valkey responds
shell: |
set -euo pipefail
Expand All @@ -17,3 +8,13 @@
when: (ansible_distribution in ['RedHat', 'CentOS'] and
ansible_distribution_major_version | int >= 10) or
ansible_distribution not in ['RedHat', 'CentOS']

- name: Check if Redis responds
shell: |
set -euo pipefail
redis-cli PING | grep PONG
changed_when: false
when:
- ansible_distribution in ['RedHat', 'CentOS']
- ansible_distribution_major_version | int > 6
- ansible_distribution_major_version | int < 10

0 comments on commit 9f46acf

Please sign in to comment.