Skip to content

Commit

Permalink
Print superuser password in “connection info” after deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks committed Sep 22, 2023
1 parent 1960f36 commit 7933e3a
Showing 1 changed file with 38 additions and 22 deletions.
60 changes: 38 additions & 22 deletions roles/deploy-finish/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,13 @@
ansible.builtin.debug:
msg:
- +------------------------------------------------+
- address (VIP) {{ cluster_vip }}
- port {{ haproxy_listen_port.master }} (read/write) master
- port {{ haproxy_listen_port.replicas }} (read only) all replicas
- port {{ haproxy_listen_port.replicas_sync }} (read only) synchronous replica only
- port {{ haproxy_listen_port.replicas_async }} (read only) asynchronous replicas only
- "address: (VIP) {{ cluster_vip }}"
- "port: {{ haproxy_listen_port.master }} (read/write) master"
- "port: {{ haproxy_listen_port.replicas }} (read only) all replicas"
- "port: {{ haproxy_listen_port.replicas_sync }} (read only) synchronous replica only"
- "port: {{ haproxy_listen_port.replicas_async }} (read only) asynchronous replicas only"
- "superuser: {{ patroni_superuser_username }}"
- "password: {% if mask_password | default(false) | bool %}'********'{% else %}{{ patroni_superuser_password }}{% endif %}"
- +------------------------------------------------+
when:
- with_haproxy_load_balancing | bool
Expand All @@ -102,9 +104,11 @@
ansible.builtin.debug:
msg:
- +------------------------------------------------+
- address (VIP) {{ cluster_vip }}
- port {{ haproxy_listen_port.master }} (read/write) master
- port {{ haproxy_listen_port.replicas }} (read only) all replicas
- "address: (VIP) {{ cluster_vip }}"
- "port: {{ haproxy_listen_port.master }} (read/write) master"
- "port: {{ haproxy_listen_port.replicas }} (read only) all replicas"
- "superuser: {{ patroni_superuser_username }}"
- "password: {% if mask_password | default(false) | bool %}'********'{% else %}{{ patroni_superuser_password }}{% endif %}"
- +------------------------------------------------+
when:
- with_haproxy_load_balancing | bool
Expand All @@ -115,8 +119,10 @@
ansible.builtin.debug:
msg:
- +------------------------------------------------+
- address (VIP) {{ cluster_vip }}
- port {% if pgbouncer_install %}{{ pgbouncer_listen_port }} (pgbouncer){% else %}{{ postgresql_port }}{% endif %}
- "address: (VIP) {{ cluster_vip }}"
- "port: {% if pgbouncer_install %}{{ pgbouncer_listen_port }} (pgbouncer){% else %}{{ postgresql_port }}{% endif %}"
- "superuser: {{ patroni_superuser_username }}"
- "password: {% if mask_password | default(false) | bool %}'********'{% else %}{{ patroni_superuser_password }}{% endif %}"
- +------------------------------------------------+
when:
- not with_haproxy_load_balancing | bool
Expand Down Expand Up @@ -170,11 +176,13 @@
ansible.builtin.debug:
msg:
- +------------------------------------------------+
- address {{ haproxy_nodes }}
- port {{ haproxy_listen_port.master }} (read/write) master
- port {{ haproxy_listen_port.replicas }} (read only) all replicas
- port {{ haproxy_listen_port.replicas_sync }} (read only) synchronous replica only
- port {{ haproxy_listen_port.replicas_async }} (read only) asynchronous replicas only
- "address: {{ haproxy_nodes }}"
- "port: {{ haproxy_listen_port.master }} (read/write) master"
- "port: {{ haproxy_listen_port.replicas }} (read only) all replicas"
- "port: {{ haproxy_listen_port.replicas_sync }} (read only) synchronous replica only"
- "port: {{ haproxy_listen_port.replicas_async }} (read only) asynchronous replicas only"
- "superuser: {{ patroni_superuser_username }}"
- "password: {% if mask_password | default(false) | bool %}'********'{% else %}{{ patroni_superuser_password }}{% endif %}"
- +------------------------------------------------+
when:
- with_haproxy_load_balancing | bool
Expand All @@ -185,9 +193,11 @@
ansible.builtin.debug:
msg:
- +------------------------------------------------+
- address {{ haproxy_nodes }}
- port {{ haproxy_listen_port.master }} (read/write) master
- port {{ haproxy_listen_port.replicas }} (read only) all replicas
- "address: {{ haproxy_nodes }}"
- "port: {{ haproxy_listen_port.master }} (read/write) master"
- "port: {{ haproxy_listen_port.replicas }} (read only) all replicas"
- "superuser: {{ patroni_superuser_username }}"
- "password: {% if mask_password | default(false) | bool %}'********'{% else %}{{ patroni_superuser_password }}{% endif %}"
- +------------------------------------------------+
when:
- with_haproxy_load_balancing | bool
Expand All @@ -198,8 +208,10 @@
ansible.builtin.debug:
msg:
- +------------------------------------------------+
- address {{ postgres_cluster_nodes }}
- port {% if pgbouncer_install %}{{ pgbouncer_listen_port }} (pgbouncer){% else %}{{ postgresql_port }}{% endif %}
- "address: {{ postgres_cluster_nodes }}"
- "port: {% if pgbouncer_install %}{{ pgbouncer_listen_port }} (pgbouncer){% else %}{{ postgresql_port }}{% endif %}"
- "superuser: {{ patroni_superuser_username }}"
- "password: {% if mask_password | default(false) | bool %}'********'{% else %}{{ patroni_superuser_password }}{% endif %}"
- +------------------------------------------------+
when:
- not with_haproxy_load_balancing | bool
Expand All @@ -219,7 +231,9 @@
- "Client access point (DNS):"
- " master.{{ patroni_cluster_name }}.service.consul "
- " replica.{{ patroni_cluster_name }}.service.consul "
- port {% if pgbouncer_install %}{{ pgbouncer_listen_port }} (pgbouncer){% else %}{{ postgresql_port }}{% endif %}
- "port: {% if pgbouncer_install %}{{ pgbouncer_listen_port }} (pgbouncer){% else %}{{ postgresql_port }}{% endif %}"
- "superuser: {{ patroni_superuser_username }}"
- "password: {% if mask_password | default(false) | bool %}'********'{% else %}{{ patroni_superuser_password }}{% endif %}"
- +------------------------------------------------+
when: not synchronous_mode | bool

Expand All @@ -233,7 +247,9 @@
- " replica.{{ patroni_cluster_name }}.service.consul "
- " sync-replica.{{ patroni_cluster_name }}.service.consul "
- " async-replica.{{ patroni_cluster_name }}.service.consul "
- port {% if pgbouncer_install %}{{ pgbouncer_listen_port }} (pgbouncer){% else %}{{ postgresql_port }}{% endif %}
- "port: {% if pgbouncer_install %}{{ pgbouncer_listen_port }} (pgbouncer){% else %}{{ postgresql_port }}{% endif %}"
- "superuser: {{ patroni_superuser_username }}"
- "password: {% if mask_password | default(false) | bool %}'********'{% else %}{{ patroni_superuser_password }}{% endif %}"
- +------------------------------------------------+
when: synchronous_mode | bool
when: dcs_type == "consul"
Expand Down

0 comments on commit 7933e3a

Please sign in to comment.