DEV-1058 removed ignore_errors

- it doesn't make sense (at all)
qa
Sven Ketelsen 3 years ago
parent 4d2de4e2d3
commit d324a30ff1

@ -16,3 +16,5 @@ shared_service_pg_slave_ip: "{{ stage_server_infos
| list | list
| first | first
| default('-') }}" | default('-') }}"
postgres_replicator_user_password: "{{ postgres_replicator_user_password_vault }}"

@ -19,5 +19,3 @@ stage_postgres_acls:
- name: "{{ stage_database_management_gitea_name }}" - name: "{{ stage_database_management_gitea_name }}"
password: "{{ stage_database_management_gitea_password }}" password: "{{ stage_database_management_gitea_password }}"
trusted_cidr_entry: "{{ shared_service_network }}" trusted_cidr_entry: "{{ shared_service_network }}"
postgres_replicator_user_password: "{{ postgres_replicator_user_password_vault }}"

@ -33,8 +33,6 @@ harbor_postgresql_password: "{{ harbor_postgresql_password_vault }}"
elastic_admin_username: "{{ elastic_admin_username_vault }}" elastic_admin_username: "{{ elastic_admin_username_vault }}"
elastic_admin_password: "{{ elastic_admin_password_vault }}" elastic_admin_password: "{{ elastic_admin_password_vault }}"
postgres_replicator_user_password: "{{ postgres_replicator_user_password_vault }}"
gitea_admin_username: "gitea-admin" gitea_admin_username: "gitea-admin"
gitea_admin_password: "{{ gitea_admin_password_vault }}" gitea_admin_password: "{{ gitea_admin_password_vault }}"
gitea_realm_admin_username: "gitea-realm-admin" gitea_realm_admin_username: "gitea-realm-admin"

@ -32,8 +32,6 @@ harbor_postgresql_password: "{{ harbor_postgresql_password_vault }}"
elastic_admin_username: "{{ elastic_admin_username_vault }}" elastic_admin_username: "{{ elastic_admin_username_vault }}"
elastic_admin_password: "{{ elastic_admin_password_vault }}" elastic_admin_password: "{{ elastic_admin_password_vault }}"
postgres_replicator_user_password: "{{ postgres_replicator_user_password_vault }}"
gitea_admin_username: "gitea-admin" gitea_admin_username: "gitea-admin"
gitea_admin_password: "{{ gitea_admin_password_vault }}" gitea_admin_password: "{{ gitea_admin_password_vault }}"
gitea_realm_admin_username: "gitea-realm-admin" gitea_realm_admin_username: "gitea-realm-admin"

@ -33,8 +33,6 @@ harbor_postgresql_password: "{{ harbor_postgresql_password_vault }}"
elastic_admin_username: "{{ elastic_admin_username_vault }}" elastic_admin_username: "{{ elastic_admin_username_vault }}"
elastic_admin_password: "{{ elastic_admin_password_vault }}" elastic_admin_password: "{{ elastic_admin_password_vault }}"
postgres_replicator_user_password: "{{ postgres_replicator_user_password_vault }}"
gitea_admin_username: "gitea-admin" gitea_admin_username: "gitea-admin"
gitea_admin_password: "{{ gitea_admin_password_vault }}" gitea_admin_password: "{{ gitea_admin_password_vault }}"
gitea_realm_admin_username: "gitea-realm-admin" gitea_realm_admin_username: "gitea-realm-admin"

@ -5,20 +5,17 @@
become_user: postgres become_user: postgres
shell: "/usr/bin/psql -Atc \"SELECT count(rolname) FROM pg_roles where rolname='replicator'\"" # noqa command-instead-of-shell shell: "/usr/bin/psql -Atc \"SELECT count(rolname) FROM pg_roles where rolname='replicator'\"" # noqa command-instead-of-shell
register: role_check register: role_check
ignore_errors: yes # noqa ignore-errors no-changed-when
- name: Create role if necessary - name: Create role if necessary
become: yes become: yes
become_user: postgres become_user: postgres
shell: "/usr/bin/psql -c 'CREATE ROLE replicator WITH REPLICATION LOGIN;'" shell: "/usr/bin/psql -c 'CREATE ROLE replicator WITH REPLICATION LOGIN;'"
when: role_check.stdout == "0" when: role_check.stdout == "0"
ignore_errors: yes # noqa ignore-errors
- name: Change password with scram-sha-256! for replicator and set password - name: Change password with scram-sha-256! for replicator and set password
become: yes become: yes
become_user: postgres become_user: postgres
shell: "/usr/bin/psql -c \"set password_encryption = 'scram-sha-256';ALTER ROLE replicator WITH PASSWORD '{{ postgres_replicator_user_password }}';\"" shell: "/usr/bin/psql -c \"set password_encryption = 'scram-sha-256';ALTER ROLE replicator WITH PASSWORD '{{ postgres_replicator_user_password }}';\""
ignore_errors: yes # noqa ignore-errors no-changed-when
- name: Setup pg_hba.conf for replicator user - name: Setup pg_hba.conf for replicator user
lineinfile: lineinfile:
@ -111,32 +108,27 @@
become_user: postgres become_user: postgres
shell: "/usr/bin/psql -Atc \"SELECT count(*) FROM pg_database WHERE datname = 'replication_cron'\"" shell: "/usr/bin/psql -Atc \"SELECT count(*) FROM pg_database WHERE datname = 'replication_cron'\""
register: database_replication_check register: database_replication_check
ignore_errors: yes # noqa ignore-errors no-changed-when
- name: Create replication_cron update database - name: Create replication_cron update database
become: yes become: yes
become_user: postgres become_user: postgres
shell: "/usr/bin/psql -c \"CREATE DATABASE replication_cron;\"" shell: "/usr/bin/psql -c \"CREATE DATABASE replication_cron;\""
when: database_replication_check.stdout == "0" when: database_replication_check.stdout == "0"
ignore_errors: yes # noqa ignore-errors no-changed-when
- name: Create replication update schema - name: Create replication update schema
become: yes become: yes
become_user: postgres become_user: postgres
shell: "/usr/bin/psql replication_cron -c \"CREATE SCHEMA IF NOT EXISTS replication_cron;\"" shell: "/usr/bin/psql replication_cron -c \"CREATE SCHEMA IF NOT EXISTS replication_cron;\""
ignore_errors: yes # noqa ignore-errors no-changed-when
- name: Create replication update table - name: Create replication update table
become: yes become: yes
become_user: postgres become_user: postgres
shell: "/usr/bin/psql replication_cron -c \"CREATE TABLE IF NOT EXISTS replication_cron.replication_cron (dt timestamp);\"" shell: "/usr/bin/psql replication_cron -c \"CREATE TABLE IF NOT EXISTS replication_cron.replication_cron (dt timestamp);\""
ignore_errors: yes # noqa ignore-errors no-changed-when
- name: Create dummy update data - name: Create dummy update data
become: yes become: yes
become_user: postgres become_user: postgres
shell: "/usr/bin/psql replication_cron -c \"INSERT INTO replication_cron.replication_cron SELECT now() WHERE NOT EXISTS (SELECT 1 from replication_cron.replication_cron);\"" shell: "/usr/bin/psql replication_cron -c \"INSERT INTO replication_cron.replication_cron SELECT now() WHERE NOT EXISTS (SELECT 1 from replication_cron.replication_cron);\""
ignore_errors: yes # noqa ignore-errors no-changed-when
- name: Ensure a cron runs every 5 minutes and update replication check table" - name: Ensure a cron runs every 5 minutes and update replication check table"
ansible.builtin.cron: ansible.builtin.cron:
@ -149,16 +141,13 @@
become_user: postgres become_user: postgres
shell: "/usr/bin/psql -Atc \"select count(*) from pg_replication_slots where slot_name='pgstandby1'\"" shell: "/usr/bin/psql -Atc \"select count(*) from pg_replication_slots where slot_name='pgstandby1'\""
register: replication_slot_check register: replication_slot_check
ignore_errors: yes # noqa ignore-errors no-changed-when
- name: Create replication-slot - name: Create replication-slot
become: yes become: yes
become_user: postgres become_user: postgres
shell: "/usr/bin/psql -Atc \"SELECT pg_create_physical_replication_slot('pgstandby1');\"" shell: "/usr/bin/psql -Atc \"SELECT pg_create_physical_replication_slot('pgstandby1');\""
ignore_errors: yes # noqa ignore-errors
when: replication_slot_check.stdout == "0" when: replication_slot_check.stdout == "0"
# only needed in case of install from scratch # only needed in case of install from scratch
- name: "Ensure test db stuff" - name: "Ensure test db stuff"
block: block:
@ -185,5 +174,4 @@
name: dummytestdb name: dummytestdb
state: restore state: restore
target: /tmp/testdb.sql target: /tmp/testdb.sql
when: postgres_ensure_testdb | default(False) when: postgres_ensure_testdb | default(False)

Loading…
Cancel
Save