Skip to content

Commit

Permalink
Add pip package install flags (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyphreak authored Mar 14, 2024
1 parent 0a539c6 commit 92489fb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
2 changes: 2 additions & 0 deletions defaults/main/params.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
postgresql_release: 16
postgresql_pip_state: present
postgresql_pip_manage: true
postgresql_package_state: present
postgresql_service_state: started
postgresql_service_enabled: true
Expand Down
15 changes: 0 additions & 15 deletions molecule/common/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,6 @@
_service: "{{ [_name] | map('extract', services) }}"
when: ansible_os_family == 'Debian'

- debug:
var: postgresql_service

- debug:
msg: "status: {{ _svc_status }}, state: {{ _svc_state }}"
vars:
_state: "{{ postgresql_service_state | default('running') }}"
_online: "{{ (ansible_os_family == 'RedHat') | ternary('enabled', 'active') }}"
_offline: "{{ (ansible_os_family == 'RedHat') | ternary('disabled', 'inactive') }}"
_status: "{{ (_state == 'running') | ternary(_online, _offline) }}"
_masked: "{{ postgresql_service_masked | default('false') | bool }}"
_svc_status: "{{ _masked | ternary('masked', _status) }}"
_stopped: "{{ (ansible_os_family == 'RedHat') | ternary('inactive', 'stopped') }}"
_svc_state: "{{ (_state == 'running') | ternary('running', _stopped) }}"

- name: Verify service state
ansible.builtin.assert:
that:
Expand Down
2 changes: 2 additions & 0 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
- name: Install required pips
ansible.builtin.pip:
name: psycopg2-binary
state: "{{ postgresql_pip_state }}"
when: postgresql_pip_manage

- name: Release package holds
ansible.builtin.include_tasks: lock.yml
Expand Down

0 comments on commit 92489fb

Please sign in to comment.