Skip to content

Commit

Permalink
Remove check for firwalld running, fix checking mssql_ha_replica_type
Browse files Browse the repository at this point in the history
  • Loading branch information
spetrosi committed May 23, 2022
1 parent b481b49 commit fac09be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 33 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,6 @@ Type: `str`

Whether to configure firewall for high availability or not.

The role configures firewall only if the `firewalld` service has been started or
enabled.

Default: `true`

Type: `bool`
Expand Down
8 changes: 1 addition & 7 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -448,13 +448,7 @@
- name: >-
Open the {{ mssql_ha_listener_port }}/tcp port and
enable the high-availability service
when:
- mssql_ha_firewall_configure | bool
- >-
('running' in
ansible_facts['services']['firewalld.service']['state']) or
('enabled' in
ansible_facts['services']['firewalld.service']['status'])
when: mssql_ha_firewall_configure | bool
include_role:
name: fedora.linux_system_roles.firewall
vars:
Expand Down
26 changes: 3 additions & 23 deletions tests/tests_configure_ha_cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,6 @@
mssql_ha_db_name: ExampleDB
mssql_debug: true
tasks:
# - name: Gather system services facts
# service_facts:

# - name: Open firewall ports for TCP connection to SQL Server
# vars:
# firewall:
# - port: "{{
# '1433' if mssql_tcp_port is not defined else mssql_tcp_port
# }}/tcp"
# zone: public
# state: enabled
# permanent: true
# runtime: true
# when: >-
# ('running' in
# ansible_facts['services']['firewalld.service']['state']) or
# ('enabled' in
# ansible_facts['services']['firewalld.service']['status'])
# include_role:
# name: fedora.linux_system_roles.firewall
- name: Skip this test on EL < 8 because ha_cluster does not support it
meta: end_play
when:
Expand All @@ -40,9 +20,9 @@
- name: Set the mssql_ha_replica_type fact to appear in hostvars
set_fact:
mssql_ha_replica_type: primary
when: ansible_play_hosts_all |
map('extract', hostvars, 'mssql_ha_replica_type') |
list is not defined
when:
- ansible_play_hosts_all | length == 1
- mssql_ha_replica_type is not defined

- name: Set up test environment for the ha_cluster role
include_role:
Expand Down

0 comments on commit fac09be

Please sign in to comment.