Further attempts to fix issues with IaC_database

This commit is contained in:
Bradley Bickford 2024-11-12 21:05:10 -05:00
parent c08184a13c
commit 0ef43910dd

View File

@ -39,6 +39,23 @@
comment: "Podman user for Postgresql Database" comment: "Podman user for Postgresql Database"
uid: 2000 uid: 2000
- name: Make .bashrc.d directory for psql user
ansible.builtin.file:
path: /home/psql/.bashrc.d
owner: psql
group: psql
mode: "0750"
state: directory
- name: Set XDG_RUNTIME_DIR var for psql user
ansible.builtin.lineinfile:
path: /home/psql/.bashrc.d/systemd
owner: psql
group: psql
mode: "0750"
line: "export XDG_RUNTIME_DIR=/run/user/2000"
create: true
- name: Allow psql user to linger - name: Allow psql user to linger
ansible.builtin.shell: ansible.builtin.shell:
cmd: "loginctl enable-linger 2000" cmd: "loginctl enable-linger 2000"
@ -66,6 +83,23 @@
comment: "Podman user for MySQL Database" comment: "Podman user for MySQL Database"
uid: 2001 uid: 2001
- name: Make .bashrc.d directory for mysql user
ansible.builtin.file:
path: /home/mysql/.bashrc.d
owner: mysql
group: mysql
mode: "0750"
state: directory
- name: Set XDG_RUNTIME_DIR var for mysql user
ansible.builtin.lineinfile:
path: /home/mysql/.bashrc.d/systemd
owner: mysql
group: mysql
mode: "0750"
line: "export XDG_RUNTIME_DIR=/run/user/2001"
create: true
- name: Allow mysql user to linger - name: Allow mysql user to linger
ansible.builtin.shell: ansible.builtin.shell:
cmd: "loginctl enable-linger 2001" cmd: "loginctl enable-linger 2001"
@ -178,10 +212,10 @@
become_user: "mysql" become_user: "mysql"
- name: Run systemctl --user daemon-reload - name: Run systemctl --user daemon-reload
ansible.builtin.shell: ansible.builtin.systemd_service:
cmd: "systemctl --user daemon-reload" daemon_reload: true
scope: user
become_user: "{{ item }}" become_user: "{{ item }}"
become_method: community.general.machinectl
loop: loop:
- psql - psql
- mysql - mysql