1
0
Fork 0
mirror of https://github.com/geerlingguy/ansible-role-postgresql.git synced 2024-11-11 13:50:50 -05:00
postgresql/molecule/default/converge.yml
2020-12-08 16:56:07 -06:00

37 lines
1 KiB
YAML

---
- name: Converge
hosts: all
become: true
vars:
postgresql_databases:
- name: example
postgresql_users:
- name: jdoe
pre_tasks:
# The Fedora 30+ container images have only C.UTF-8 installed
- name: Set database locale if using Fedora 30+ or RedHat 8+
set_fact:
postgresql_databases:
- name: example
lc_collate: 'C.UTF-8'
lc_ctype: 'C.UTF-8'
when:
- ( ansible_distribution == 'Fedora' and ansible_distribution_major_version >= '30') or
( ansible_os_family == 'RedHat' and ansible_distribution_major_version == '8')
- name: Update apt cache.
apt: update_cache=true cache_valid_time=600
changed_when: false
when: ansible_os_family == 'Debian'
roles:
- role: geerlingguy.postgresql
post_tasks:
- name: Verify postgres is running.
command: "{{ postgresql_bin_path }}/pg_ctl -D {{ postgresql_data_dir }} status"
changed_when: false
become: true
become_user: postgres