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

27 lines
880 B
YAML
Raw Normal View History

2022-10-12 10:08:57 +00:00
- hosts: mysql
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.mysql.mysql_info:
login_user: "{{ jms_account.username }}"
login_password: "{{ jms_account.secret }}"
login_host: "{{ jms_asset.address }}"
login_port: "{{ jms_asset.port }}"
check_hostname: "{{ jms_asset.spec_info.use_ssl and not jms_asset.spec_info.allow_invalid_cert }}"
ca_cert: "{{ jms_asset.secret_info.ca_cert | default(omit) }}"
client_cert: "{{ jms_asset.secret_info.client_cert | default(omit) }}"
client_key: "{{ jms_asset.secret_info.client_key | default(omit) }}"
2022-10-25 10:43:34 +00:00
filter: version
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-12 10:08:57 +00:00
set_fact:
info:
version: "{{ db_info.version.full }}"
- debug:
2022-10-25 10:43:34 +00:00
var: info