postgresql/tasks/main.yaml

36 lines
964 B
YAML
Raw Normal View History

2023-02-07 23:13:12 +00:00
- name: Make sure handlers are flushed immediately
meta: flush_handlers
- name: Load a variable file based on the OS type
include_vars: "{{ lookup('first_found', params) }}"
vars:
params:
files:
- "{{ ansible_facts['distribution'] }}.yaml"
- "{{ ansible_facts['os_family'] }}.yaml"
paths:
- "vars"
tags: postgresql_vars
- name: "Install PostgreSQL for {{ ansible_facts['os_family'] }}"
include_tasks: "{{ ansible_facts['os_family'] }}/main.yaml"
tags: postgresql_setup
- name: "Configure PostgreSQL"
include_tasks: config.yaml
tags: postgresql_configuration
- name: Enable and start PostgreSQL
systemd:
daemon_reload: true
name: "postgresql-{{ postgresql_major_version }}"
enabled: true
state: started
masked: no
register: postgresql_enable_and_start
tags: postgresql, postgresql_start
- name: "Configure PostgreSQL"
include_tasks: user.yaml
tags: postgresql_postgres_user