Skip to content

Commit

Permalink
fix: Try to fix #82 (#91)
Browse files Browse the repository at this point in the history
Co-authored-by: Samuel Mutel <smu-dw@deveryware.net>
  • Loading branch information
smutel and Samuel Mutel authored Jul 30, 2021
1 parent 786b8bb commit df7a712
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

patroni_postgresql_version: 11
patroni_postgresql_exists: false
patroni_install_from_pip: true

patroni_config_dir: /etc/patroni
patroni_config_file: "{{ inventory_hostname }}.yml"
Expand Down
2 changes: 2 additions & 0 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
owner: "{{ patroni_system_user }}"
group: "{{ patroni_system_group }}"
mode: 0750
when: patroni_install_from_pip

- name: Create patroni log directory
file:
Expand Down Expand Up @@ -36,6 +37,7 @@
owner: root
group: root
mode: 0644
when: patroni_install_from_pip

- name: Create patroni configuration file
template:
Expand Down
3 changes: 3 additions & 0 deletions tasks/install.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---

- import_tasks: user.yml
when: patroni_install_from_pip

- import_tasks: postgresql.yml
when: not patroni_postgresql_exists
Expand All @@ -15,6 +16,7 @@
update_cache: yes
with_items:
- "{{ patroni_system_packages }}"
when: patroni_install_from_pip

- name: Install pip packages for patroni
pip:
Expand All @@ -24,3 +26,4 @@
executable: "{{ item.executable }}"
with_items:
- "{{ patroni_pip_packages }}"
when: patroni_install_from_pip
16 changes: 15 additions & 1 deletion tasks/variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,18 @@
- name: Define patroni_bin_dir.
set_fact:
patroni_bin_dir: "{{ __patroni_bin_dir }}"
when: patroni_bin_dir is not defined
when:
- patroni_bin_dir is not defined
- patroni_install_from_pip

- name: Define patroni_bin_dir.
set_fact:
patroni_bin_dir: "/usr/bin"
when:
- patroni_bin_dir is not defined
- not patroni_install_from_pip

- name: Override patroni_config_file
set_fact:
patroni_config_file: "config.yml"
when: not patroni_install_from_pip

0 comments on commit df7a712

Please sign in to comment.