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

23 lines
595 B
YAML
Raw Normal View History

2022-10-12 10:08:57 +00:00
- hosts: postgre
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 }}"
login_db: "{{ jms_asset.database }}"
register: db_info
2022-10-25 10:43:34 +00:00
- name: Define Postgresql info by set_fact
set_fact:
info:
version: "{{ db_info.server_version.raw }}"
- debug:
var: info