1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

community.postgresql on-demand

This commit is contained in:
Jerry Vonau 2025-02-20 16:55:01 -06:00
parent 22b3199863
commit 55b572cda0
2 changed files with 6 additions and 2 deletions

View file

@ -6,7 +6,8 @@
collections: collections:
- name: community.general - name: community.general
- name: community.mysql - 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... - name: ansible.posix # 2025-02-20: For ~4 modules below...
# selinux WAS in /opt/iiab/iiab/roles/1-prep/tasks/main.yml # selinux WAS in /opt/iiab/iiab/roles/1-prep/tasks/main.yml

View file

@ -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 - 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: ansible.builtin.pip:
name: psycopg 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 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) - 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].*//' shell: pg_config --version | sed 's/^[^0-9]*//; s/[^0-9].*//'
register: pg_config_version register: pg_config_version