fix(postgresql): ignore errors on first run in check mode, support overriding internal postgresql container username, fix container image name creation

This commit is contained in:
2025-04-20 12:16:12 +02:00
parent f9f00d1919
commit 5fa26ed187
5 changed files with 16 additions and 5 deletions

View File

@ -54,7 +54,13 @@
vars:
postgresql_login_host: >-2
{{
(postgresql_config_unix_socket_directories | first)
(
(postgresql_deployment_method in ['docker'])
| ternary(
postgresql_unix_socket_path,
(postgresql_config_unix_socket_directories | first)
)
)
if postgresql_config_connect_socket else
(postgresql_container_info.container.NetworkSettings.IPAddress)
}}

View File

@ -51,12 +51,14 @@
name: "{{ postgresql_systemd_tmpfile_socket_correction_unit_name }}.service"
state: "{{ postgresql_container_state }}"
when: ansible_facts['service_mgr'] == 'systemd'
ignore_errors: "{{ ansible_check_mode }}"
- name: Ensure systemd unit {{ postgresql_systemd_tmpfile_socket_correction_unit_name }} is {{ postgresql_container_state }}
ansible.builtin.systemd:
name: "{{ postgresql_systemd_tmpfile_socket_correction_unit_name }}.service"
enabled: "{{ postgresql_state == 'present' }}"
when: ansible_facts['service_mgr'] == 'systemd'
ignore_errors: "{{ ansible_check_mode }}"
- name: Lookup {{ postgresql_data_path }}/global
ansible.builtin.stat: