From 062c6efd6ffe7bef9e72b5b6583c95b20fc49c92 Mon Sep 17 00:00:00 2001 From: Alex Demidoff Date: Wed, 6 Dec 2023 17:11:39 +0000 Subject: [PATCH] PMM-12692 create a user with a script --- build/ansible/roles/pmm-images/tasks/main.yml | 9 -------- .../tasks/roles/postgres/tasks/main.yml | 22 +++++++++---------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/build/ansible/roles/pmm-images/tasks/main.yml b/build/ansible/roles/pmm-images/tasks/main.yml index cf64ad248b..591ce88424 100644 --- a/build/ansible/roles/pmm-images/tasks/main.yml +++ b/build/ansible/roles/pmm-images/tasks/main.yml @@ -138,15 +138,6 @@ include_role: name: pmm-client -- name: Remove ansible RPM if installed | EL9 - when: - - ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux' - - ansible_distribution_major_version == '9' - yum: - name: ansible - state: absent - ignore_errors: true - - name: Install ansible-core RPM | EL9 when: - ansible_distribution == 'OracleLinux' or ansible_distribution == 'AlmaLinux' diff --git a/update/ansible/playbook/tasks/roles/postgres/tasks/main.yml b/update/ansible/playbook/tasks/roles/postgres/tasks/main.yml index e1b6723a3f..a6e6bdfe10 100644 --- a/update/ansible/playbook/tasks/roles/postgres/tasks/main.yml +++ b/update/ansible/playbook/tasks/roles/postgres/tasks/main.yml @@ -76,17 +76,15 @@ become_method: su - name: Create postgres user - postgresql_user: - db: postgres - name: postgres - password: "postgres" - priv: "ALL" - expires: infinity - state: present + shell: /usr/pgsql-14/bin/createuser --echo --superuser --host=/run/postgresql --no-password postgres + become: true + become_user: pmm + become_method: su - name: Create pmm-managed database postgresql_db: name: pmm-managed + login_user: pmm state: present - name: Create pmm-managed user @@ -117,10 +115,10 @@ - remove - add - - name: Run pmm-managed again - supervisorctl: - name: pmm-managed - state: started - become: true + # - name: Run pmm-managed again + # supervisorctl: + # name: pmm-managed + # state: started + # become: true when: not postgres_14_dir.stat.exists