mirror of
https://gitea.0xace.cc/ansible-galaxy/postgresql.git
synced 2025-01-18 03:52:24 +00:00
fix
This commit is contained in:
parent
41f598a238
commit
2ea9e25263
@ -1,6 +1,7 @@
|
||||
postgresql_version: "15.2"
|
||||
|
||||
# Options
|
||||
postgresql_install_official_repo: true
|
||||
postgresql_play_group: "postgresql"
|
||||
postgresql_superuser_db: "postgres"
|
||||
postgresql_superuser_username: "postgres"
|
||||
|
@ -6,6 +6,13 @@
|
||||
group: "postgres"
|
||||
state: directory
|
||||
|
||||
- name: Create configuration directory
|
||||
file:
|
||||
path: "{{ postgresql_config_dir }}/{{ postgresql_major_version }}/{{ postgresql_cluster_name }}"
|
||||
owner: "postgres"
|
||||
group: "postgres"
|
||||
state: directory
|
||||
|
||||
- name: Merge user options for PostgreSQL config
|
||||
set_fact:
|
||||
postgresql_combined_parameters: "{{ postgresql_default_parameters | combine(postgresql_custom_parameters|default({}), recursive=true) }}"
|
||||
|
@ -9,6 +9,7 @@
|
||||
url: "{{ item.url }}"
|
||||
keyring: "{{ item.keyring }}"
|
||||
loop: "{{ postgresql_apt_key }}"
|
||||
when: postgresql_install_official_repo
|
||||
|
||||
- name: Add PostgreSQL repository
|
||||
ansible.builtin.apt_repository:
|
||||
@ -16,7 +17,24 @@
|
||||
state: present
|
||||
filename: "{{ item.filename }}"
|
||||
update_cache: yes
|
||||
loop: "{{ postgresql_apt_repository }}"
|
||||
loop: "{{ postgresql_apt_repository }}"
|
||||
when: postgresql_install_official_repo
|
||||
|
||||
- name: Install postgresql-common
|
||||
apt:
|
||||
name: postgresql-common
|
||||
state: present
|
||||
|
||||
- name: Create dir createcluster.d
|
||||
file:
|
||||
path: /etc/postgresql-common/createcluster.d
|
||||
state: directory
|
||||
|
||||
- name: Disable main cluster creation by default
|
||||
copy:
|
||||
dest: /etc/postgresql-common/createcluster.d/create-main-cluster.conf
|
||||
content: |
|
||||
create_main_cluster = false
|
||||
|
||||
- name: Gather packages
|
||||
package_facts:
|
||||
@ -37,7 +55,7 @@
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ postgresql_unit_name }}"
|
||||
masked: yes
|
||||
when: postgresql_package_name not in ansible_facts.packages or ansible_facts.packages[postgresql_package_name][0]['version'] != (postgresql_version + "-" + postgresql_version_build)
|
||||
when: postgresql_package_name not in ansible_facts.packages or ansible_facts.packages[postgresql_package_name][0]['version'] != (postgresql_version|string + "-" + postgresql_version_build|string)
|
||||
|
||||
- name: "Install {{ postgresql_package_name }}-{{ postgresql_version }}-{{ postgresql_version_build }}"
|
||||
apt:
|
||||
@ -54,4 +72,4 @@
|
||||
notify: Restart PostgreSQL
|
||||
when:
|
||||
- postgresql_package_name in ansible_facts.packages
|
||||
- ansible_facts.packages[postgresql_package_name][0]['version'] != (postgresql_version + "-" + postgresql_version_build)
|
||||
- ansible_facts.packages[postgresql_package_name][0]['version'] != (postgresql_version|string + "-" + postgresql_version_build|string)
|
||||
|
@ -15,6 +15,7 @@
|
||||
name: "{{ postgresql_repo_package }}"
|
||||
disable_gpg_check: yes
|
||||
state: present
|
||||
when: postgresql_install_official_repo
|
||||
|
||||
- name: "Install {{ postgresql_package_name }} {{ postgresql_version }}"
|
||||
dnf:
|
||||
|
Loading…
Reference in New Issue
Block a user