2022-10-27 10:53:10 +00:00
|
|
|
- hosts: postgresql
|
2022-10-12 10:08:57 +00:00
|
|
|
gather_facts: no
|
|
|
|
vars:
|
|
|
|
ansible_python_interpreter: /usr/local/bin/python
|
|
|
|
|
|
|
|
tasks:
|
2022-10-25 10:43:34 +00:00
|
|
|
- name: Get info
|
2022-10-12 10:08:57 +00:00
|
|
|
community.postgresql.postgresql_info:
|
|
|
|
login_user: "{{ jms_account.username }}"
|
|
|
|
login_password: "{{ jms_account.secret }}"
|
|
|
|
login_host: "{{ jms_asset.address }}"
|
|
|
|
login_port: "{{ jms_asset.port }}"
|
2022-11-02 11:25:39 +00:00
|
|
|
login_db: "{{ jms_asset.specific.db_name }}"
|
2022-10-12 10:08:57 +00:00
|
|
|
register: db_info
|
|
|
|
|
2022-10-27 10:53:10 +00:00
|
|
|
- name: Define info by set_fact
|
2022-10-25 10:43:34 +00:00
|
|
|
set_fact:
|
|
|
|
info:
|
|
|
|
version: "{{ db_info.server_version.raw }}"
|
|
|
|
|
|
|
|
- debug:
|
|
|
|
var: info
|