Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pip package install flags #10

Merged
merged 2 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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