Skip to content

Commit

Permalink
PMM-12692 create a user with a script
Browse files Browse the repository at this point in the history
  • Loading branch information
ademidoff committed Dec 6, 2023
1 parent ff729a9 commit 062c6ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
9 changes: 0 additions & 9 deletions build/ansible/roles/pmm-images/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
22 changes: 10 additions & 12 deletions update/ansible/playbook/tasks/roles/postgres/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 062c6ef

Please sign in to comment.