Skip to content

Commit

Permalink
fix: rename the variable for exporting configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjelinek committed Dec 4, 2024
1 parent 365f54c commit 4be7b3c
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ ansible-galaxy collection install -r meta/collection-requirements.yml

### Defined in `defaults/main.yml`

#### `ha_cluster_get_info`
#### `ha_cluster_export_configuration`

boolean, default: `false`

Expand Down Expand Up @@ -1600,25 +1600,25 @@ may not be present in the export.
ones.

To export current cluster configuration and store it in `ha_cluster_facts`
variable, run the role with `ha_cluster_get_info: true`. This triggers the
export once the role finishes configuring a cluster or a qnetd host. If you
want to trigger the export without modifying existing configuration, run the
role like this:
variable, run the role with `ha_cluster_export_configuration: true`. This
triggers the export once the role finishes configuring a cluster or a qnetd
host. If you want to trigger the export without modifying existing
configuration, run the role like this:

```yaml
- hosts: node1
vars:
ha_cluster_cluster_present: null
ha_cluster_qnetd: null
ha_cluster_get_info: true
ha_cluster_export_configuration: true
roles:
- linux-system-roles.ha_cluster
```

**Note:** By default, `ha_cluster_cluster_present` is set to `true` and
`ha_cluster_qnetd.present` is set to `false`. If you do not set the variables as
show in the example above, the role will reconfigure your cluster on the
shown in the example above, the role will reconfigure your cluster on the
specified hosts, remove qnetd configuration from the specified hosts, and then
export configuration.

Expand All @@ -1633,7 +1633,7 @@ module like this:
vars:
ha_cluster_cluster_present: null
ha_cluster_qnetd: null
ha_cluster_get_info: true
ha_cluster_export_configuration: true
roles:
- linux-system-roles.ha_cluster
Expand All @@ -1653,7 +1653,7 @@ around it:
vars:
ha_cluster_cluster_present: null
ha_cluster_qnetd: null
ha_cluster_get_info: true
ha_cluster_export_configuration: true
roles:
- linux-system-roles.ha_cluster
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@ ha_cluster_qnetd:
regenerate_keys: false
start_on_boot: true

ha_cluster_get_info: false
ha_cluster_export_configuration: false
2 changes: 1 addition & 1 deletion examples/export.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
vars:
ha_cluster_cluster_present: null
ha_cluster_qnetd: null
ha_cluster_get_info: true
ha_cluster_export_configuration: true

roles:
- linux-system-roles.ha_cluster
Expand Down
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@

- name: Export configuration
when:
- ha_cluster_get_info | bool
- ha_cluster_export_configuration | bool
- ha_cluster_pacemaker_shell == "pcs"
block:
- name: Fetch configuration
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_cluster_advanced_knet_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
hosts: all
vars_files: vars/main.yml
vars:
ha_cluster_get_info: true
ha_cluster_export_configuration: true
ha_cluster_cluster_name: test-cluster
ha_cluster_transport:
type: knet
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_cluster_advanced_knet_implicit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
hosts: all
vars_files: vars/main.yml
vars:
ha_cluster_get_info: true
ha_cluster_export_configuration: true
ha_cluster_cluster_name: test-cluster
ha_cluster_transport:
crypto:
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_cluster_advanced_udp_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
hosts: all
vars_files: vars/main.yml
vars:
ha_cluster_get_info: true
ha_cluster_export_configuration: true
ha_cluster_cluster_name: test-cluster
ha_cluster_transport:
type: udp
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_cluster_basic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
vars_files: vars/main.yml
vars:
ha_cluster_cluster_name: test-cluster
ha_cluster_get_info: true
ha_cluster_export_configuration: true

tasks:
- name: Run test
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_cluster_basic_disabled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
vars:
ha_cluster_cluster_name: test-cluster
ha_cluster_start_on_boot: false
ha_cluster_get_info: true
ha_cluster_export_configuration: true

tasks:
- name: Run test
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_cluster_destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: Deconfigure cluster
hosts: all
vars:
ha_cluster_get_info: true
ha_cluster_export_configuration: true
ha_cluster_cluster_present: false

tasks:
Expand Down
4 changes: 2 additions & 2 deletions tests/tests_export_doesnt_destroy_cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
vars:
ha_cluster_cluster_present: null
ha_cluster_qnetd: null
ha_cluster_get_info: true
ha_cluster_export_configuration: true

- name: Compare expected and exported configuration 1
assert:
Expand All @@ -57,7 +57,7 @@
vars:
ha_cluster_cluster_present: null
ha_cluster_qnetd: null
ha_cluster_get_info: true
ha_cluster_export_configuration: true

- name: Compare expected and exported configuration 2
assert:
Expand Down

0 comments on commit 4be7b3c

Please sign in to comment.