From 19633f0ab87693e003e9e7738f4aaab3c16ed5f4 Mon Sep 17 00:00:00 2001 From: h3ct0r Date: Sun, 23 Jun 2019 19:39:00 -0300 Subject: [PATCH] fixed problem with Ansible and Postgres 10 blocking commands without encryption --- ansible_install/roles/piponger/tasks/main.yml | 9 +++++++-- ansible_install/roles/postgresql/tasks/main.yml | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ansible_install/roles/piponger/tasks/main.yml b/ansible_install/roles/piponger/tasks/main.yml index 49b2983..49cea97 100644 --- a/ansible_install/roles/piponger/tasks/main.yml +++ b/ansible_install/roles/piponger/tasks/main.yml @@ -45,11 +45,16 @@ become: yes file: path="{{ final_piponger_dir }}" state=directory -- name: Add host key to know hosts +- name: Add host key to know hosts (become no) become: no delegate_to: localhost local_action: command ssh-keyscan {{ ansible_default_ipv4.address }} >> ~/.ssh/known_hosts +- name: Add host key to know hosts (become yes) + become: yes + delegate_to: localhost + local_action: command ssh-keyscan {{ ansible_default_ipv4.address }} >> ~/.ssh/known_hosts + - name: define manual rsync become: no delegate_to: localhost @@ -90,7 +95,7 @@ become: true template: src: templates/config_default.cfg - dest: "/srv/piponger/config_default.cfg" + dest: "/srv/piponger/config.cfg" - name: set correct owner and permissions become: yes diff --git a/ansible_install/roles/postgresql/tasks/main.yml b/ansible_install/roles/postgresql/tasks/main.yml index 07d3f1a..afff2cb 100644 --- a/ansible_install/roles/postgresql/tasks/main.yml +++ b/ansible_install/roles/postgresql/tasks/main.yml @@ -49,7 +49,7 @@ - name: Create piponger_user role for database become: yes become_user: postgres - postgresql_user: db="{{ dbname }}" user="{{ dbuser }}" password="{{ database_passwd }}" priv=ALL state=present + postgresql_user: db="{{ dbname }}" user="{{ dbuser }}" password="{{ database_passwd }}" encrypted=yes priv=ALL state=present - name: Start the Postgresql service become: yes @@ -67,7 +67,7 @@ - name: ensure user has access to database become: yes become_user: postgres - postgresql_user: db="{{ dbname }}" name="{{ dbuser }}" password="{{ database_passwd }}" priv=ALL + postgresql_user: db="{{ dbname }}" name="{{ dbuser }}" password="{{ database_passwd }}" encrypted=yes priv=ALL - name: Grant table permissions for piponger_user role become: yes