diff --git a/collections.yml b/collections.yml index ae2996e4a..970d5559a 100644 --- a/collections.yml +++ b/collections.yml @@ -6,7 +6,8 @@ collections: - name: community.general - name: community.mysql - - name: community.postgresql +# 2025-02-20 moved to /opt/iiab/iiab/roles/postgresql/tasks/install.yml +# - name: community.postgresql - name: ansible.posix # 2025-02-20: For ~4 modules below... # selinux WAS in /opt/iiab/iiab/roles/1-prep/tasks/main.yml diff --git a/roles/postgresql/tasks/install.yml b/roles/postgresql/tasks/install.yml index 924b6024f..9c4926a8b 100644 --- a/roles/postgresql/tasks/install.yml +++ b/roles/postgresql/tasks/install.yml @@ -14,9 +14,12 @@ - name: pip install 'psycopg' (NEW Psycopg 3) into venv /usr/local/ansible -- for Ansible modules {postgresql_db, postgresql_user} in Ansible collection community.postgresql -- used in moodle/tasks/install.yml ansible.builtin.pip: name: psycopg - virtualenv: /usr/local/ansible + virtualenv: "{{ ansible_venv_path }}" extra_args: "--upgrade --no-cache-dir --prefer-binary" # 2023-10-01: Lifesaver when recent wheels (e.g. piwheels.org) are inevitably not yet built! SEE #3560 +- name: Install Collection community.postgresql with ansible-galaxy + shell: "{{ ansible_venv_path }}/bin/ansible-galaxy collection install --force-with-deps community.postgresql -p {{ ansible_collections_path }}" + - name: Run shell command "pg_config --version" to extract MAJOR version number -- strip off MINOR/PATCH version number(s) shell: pg_config --version | sed 's/^[^0-9]*//; s/[^0-9].*//' register: pg_config_version