Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
mode: 0644
with_items: "{{ postgresql_global_config_options }}"
notify: restart postgresql
become: true

- name: Configure host based authentication (if entries are configured).
template:
Expand All @@ -18,6 +19,7 @@
mode: 0600
notify: restart postgresql
when: postgresql_hba_entries | length > 0
become: true

- name: Ensure PostgreSQL unix socket dirs exist.
file:
Expand All @@ -27,3 +29,4 @@
group: "{{ postgresql_group }}"
mode: "{{ postgresql_unix_socket_directories_mode }}"
with_items: "{{ postgresql_unix_socket_directories }}"
become: true
4 changes: 4 additions & 0 deletions tasks/initialize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
dest: /etc/profile.d/postgres.sh
mode: 0644
notify: restart postgresql
become: true

- name: Ensure PostgreSQL data directory exists.
file:
Expand All @@ -13,11 +14,13 @@
group: "{{ postgresql_group }}"
state: directory
mode: 0700
become: true

- name: Check if PostgreSQL database is initialized.
stat:
path: "{{ postgresql_data_dir }}/PG_VERSION"
register: pgdata_dir_version
become: true

- name: Ensure PostgreSQL database is initialized.
command: "{{ postgresql_bin_path }}/initdb -D {{ postgresql_data_dir }}"
Expand All @@ -35,3 +38,4 @@
group: "{{ postgresql_group }}"
state: directory
mode: 0700
become: true
1 change: 1 addition & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
name: "{{ postgresql_daemon }}"
state: "{{ postgresql_service_state }}"
enabled: "{{ postgresql_service_enabled }}"
become: true

# Configure PostgreSQL.
- import_tasks: users.yml
Expand Down
2 changes: 2 additions & 0 deletions tasks/setup-RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
# to be installed, which breaks later Ansible runs on Fedora 30,
# and affects system behavior in multiple ways.
exclude: python-unversioned-command
become: true

- name: Ensure PostgreSQL Python libraries are installed.
yum:
name: "{{ postgresql_python_library }}"
state: present
enablerepo: "{{ postgresql_enablerepo | default(omit, true) }}"
become: true
Loading