This is an automated email from the ASF dual-hosted git repository. jhg03a pushed a commit to branch ansible.refactor in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
commit 157c4c18839acb6dcfe96688fb32cec4289953db Author: Jonathan Gray <[email protected]> AuthorDate: Mon Sep 16 18:28:12 2019 -0600 More agressively restart postgres --- .../roles/traffic_opsdb/tasks/initialize_traffic_opsdb.yml | 2 ++ .../ansible/roles/traffic_opsdb/tasks/traffic_opsdb.yml | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/infrastructure/ansible/roles/traffic_opsdb/tasks/initialize_traffic_opsdb.yml b/infrastructure/ansible/roles/traffic_opsdb/tasks/initialize_traffic_opsdb.yml index 6b59769..52dbb7f 100644 --- a/infrastructure/ansible/roles/traffic_opsdb/tasks/initialize_traffic_opsdb.yml +++ b/infrastructure/ansible/roles/traffic_opsdb/tasks/initialize_traffic_opsdb.yml @@ -33,6 +33,7 @@ role_attr_flags: SUPERUSER,LOGIN,CREATEDB ssl_rootcert: "{{ postgresql_certs_ca }}" no_log: true + notify: Restart Traffic OpsDB - name: Create Traffic Ops Database postgresql_db: @@ -40,3 +41,4 @@ name: "{{ todb_db_name }}" owner: "{{ todb_username }}" port: "{{ postgresql_port }}" + notify: Restart Traffic OpsDB diff --git a/infrastructure/ansible/roles/traffic_opsdb/tasks/traffic_opsdb.yml b/infrastructure/ansible/roles/traffic_opsdb/tasks/traffic_opsdb.yml index 84c0af0..56b05ec 100644 --- a/infrastructure/ansible/roles/traffic_opsdb/tasks/traffic_opsdb.yml +++ b/infrastructure/ansible/roles/traffic_opsdb/tasks/traffic_opsdb.yml @@ -24,6 +24,7 @@ enablerepo: "{{ additional_yum_repos | default([]) }}" retries: 5 delay: 5 + notify: Restart Traffic OpsDB - name: Ensure postgres data directory exists file: @@ -31,7 +32,8 @@ path: "{{ postgresql_datadir }}" owner: "{{ postgresql_user }}" group: "{{ postgresql_group }}" - mode: 0755 + mode: 0700 + notify: Restart Traffic OpsDB - name: Initialize database shell: "/usr/pgsql-9.6/bin/initdb -D '{{ postgresql_datadir }}'" @@ -39,6 +41,7 @@ become_user: "{{ postgresql_user }}" args: creates: "{{ postgresql_datadir }}/pg_hba.conf" + notify: Restart Traffic OpsDB - name: Update the systemd definition of PGDATA ini_file: @@ -47,6 +50,7 @@ section: Service option: Environment value: "PGDATA={{ postgresql_datadir }}" + notify: Restart Traffic OpsDB - name: Refresh Systemd systemd: @@ -76,11 +80,12 @@ src: "templates/{{ item }}.j2" owner: "{{ postgresql_user }}" group: "{{ postgresql_group }}" - mode: 0775 + mode: 0700 dest: "{{ postgresql_datadir }}/{{ item }}" with_items: - pg_hba.conf - postgresql.conf + notify: Restart Traffic OpsDB - name: Copy in SSL certificate copy: @@ -90,6 +95,7 @@ group: "{{ postgresql_group }}" mode: 0600 remote_src: yes + notify: Restart Traffic OpsDB - name: Copy in SSL private key copy: @@ -99,6 +105,7 @@ group: "{{ postgresql_group }}" mode: 0600 remote_src: yes + notify: Restart Traffic OpsDB - name: Copy in SSL CA certificate copy: @@ -108,6 +115,7 @@ group: "{{ postgresql_group }}" mode: 0600 remote_src: yes + notify: Restart Traffic OpsDB - name: Update Log Directory Permissions file: @@ -116,6 +124,7 @@ owner: "{{ postgresql_user }}" group: "{{ postgresql_group }}" mode: 0775 + notify: Restart Traffic OpsDB - name: Enable and start TODB systemd:
