jumpserver/apps/assets/automations/gather_facts/database/postgresql/main.yml

23 lines
594 B
YAML
Raw Normal View History

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: /opt/py3/bin/python
2022-10-12 10:08:57 +00:00
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 }}"
2023-01-31 09:57:06 +00:00
login_db: "{{ jms_asset.spec_info.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