1
0
Fork 0
mirror of https://github.com/ansible-collections/community.mysql.git synced 2026-02-04 07:11:49 +00:00
community.mysql/tests/integration/targets/setup_controller/tasks/verify.yml
2025-09-15 14:19:59 +02:00

59 lines
1.7 KiB
YAML

---
- vars:
mysql_parameters: &mysql_params
login_user: root
login_password: msandbox
login_host: "{{ gateway_addr }}"
login_port: 3307
block:
- name: Query Primary container over TCP for MySQL/MariaDB version
mysql_info:
<<: *mysql_params
filter:
- version
register: primary_info
- name: Assert that test container runs the expected MySQL/MariaDB version
assert:
that:
- registred_db_version == db_version
vars:
registred_db_version:
"{{ primary_info.version.major }}.{{ primary_info.version.minor }}\
.{{ primary_info.version.release }}"
- name: Assert that mysql_info module used the expected version of pymysql
assert:
that:
- primary_info.connector_name == connector_name
- primary_info.connector_version == connector_version
when:
- connector_name == 'pymysql'
- name: Get the python version in use
ansible.builtin.shell:
cmd: echo $( $(command -v python || command -v python3) -V )
changed_when: false
failed_when: false
register: python_version_in_use
- name: Display the python version in use
ansible.builtin.debug:
msg: >
Python in use inside the test container:
{{ python_version_in_use.stdout }}
when:
- python_version_in_use is defined
- name: Assert that we run the expected ansible version
assert:
that:
- ansible_running_version == test_ansible_version
vars:
ansible_running_version:
"{{ ansible_version.major }}.{{ ansible_version.minor }}"
when:
- test_ansible_version != 'devel' # Devel will change overtime