You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible-msvsphere.ci/roles/postgresql_server/tasks/main.yml

35 lines
971 B

---
- name: Install PostgreSQL server
ansible.builtin.dnf:
name: "{{ (postgresql_major_version == '13') | ternary('postgresql-server', '@postgresql:15/server') }}"
state: present
- name: Init PostgreSQL database
ansible.builtin.command: postgresql-setup --initdb
args:
creates: /var/lib/pgsql/data/pg_hba.conf
- name: Create /etc/systemd/system/postgresql.service.d directory
ansible.builtin.file:
path: /etc/systemd/system/postgresql.service.d
state: directory
owner: root
group: root
mode: '0755'
- name: Configure PostgreSQL service to start after network is online
ansible.builtin.copy:
src: 10-after-network-online.conf
dest: /etc/systemd/system/postgresql.service.d/10-after-network-online.conf
owner: root
group: root
mode: '0644'
- include_tasks: postgresql_conf.yml
- name: Enable and start postgresql service
ansible.builtin.service:
name: postgresql
enabled: true
state: started