From 92489fb1ad89269cac2071d07a6ae7a4dd8afca8 Mon Sep 17 00:00:00 2001 From: Teodoro Cook Date: Wed, 13 Mar 2024 19:00:56 -0600 Subject: [PATCH] Add pip package install flags (#10) --- defaults/main/params.yml | 2 ++ molecule/common/verify.yml | 15 --------------- tasks/install.yml | 2 ++ 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/defaults/main/params.yml b/defaults/main/params.yml index f498f39..5a487fd 100644 --- a/defaults/main/params.yml +++ b/defaults/main/params.yml @@ -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 diff --git a/molecule/common/verify.yml b/molecule/common/verify.yml index 8f6eaff..fa3c8d4 100644 --- a/molecule/common/verify.yml +++ b/molecule/common/verify.yml @@ -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: diff --git a/tasks/install.yml b/tasks/install.yml index 9a255af..0a3cb0e 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -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