Skip to content

Commit

Permalink
remove duplicates of the patroni_conf tag
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks committed Jun 3, 2023
1 parent ea1ca14 commit d5b2e72
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions config_pgcluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@
register: patroni_leader_result
changed_when: false
failed_when: false
tags: patroni_conf

- name: '[Prepare] Add host to group "primary" (in-memory inventory)'
add_host:
Expand All @@ -245,7 +244,6 @@
when: hostvars[item]['patroni_leader_result']['status'] == 200
loop: "{{ groups['postgres_cluster'] }}"
changed_when: false
tags: patroni_conf

- name: '[Prepare] Add hosts to group "secondary" (in-memory inventory)'
add_host:
Expand All @@ -254,15 +252,13 @@
when: hostvars[item]['patroni_leader_result']['status'] != 200
loop: "{{ groups['postgres_cluster'] }}"
changed_when: false
tags: patroni_conf

- name: "Print Patroni Cluster info"
debug:
msg:
- "Cluster Name: {{ patroni_cluster_name }}"
- "Cluster Leader: {{ ansible_hostname }}"
when: inventory_hostname in groups['primary']
tags: patroni_conf

- name: "Check if there are any changed parameters that require a restart"
become_user: postgres
Expand All @@ -274,20 +270,19 @@
login_db: "postgres"
query: "select name from pg_settings where pending_restart is true"
register: pending_restart_result
tags: patroni_conf

- name: "Set pg_pending_restart_settings variable"
set_fact:
pg_pending_restart_settings: "{{ pending_restart_result.query_result }}"
tags: patroni_conf

- name: "Display parameters requiring PostgreSQL restart"
debug:
msg:
- "On server {{ ansible_hostname }}, the following parameters have changed and require PostgreSQL to restart:"
- "{{ pg_pending_restart_settings | map(attribute='name') | list }}"
when: pg_pending_restart_settings | length > 0
tags: patroni_conf
tags:
- patroni_conf

- name: config_pgcluster.yml | Restart patroni on secondary after config settings if need
hosts: secondary
Expand Down

0 comments on commit d5b2e72

Please sign in to comment.