--- - name: "{{ role_name }} | Setvars | Gather facts" ansible.builtin.setup: - name: "{{ role_name }} | Setvars | Set Fact" ansible.builtin.set_fact: gateway_addr: "{{ ansible_default_ipv4.gateway }}" db_engine_name_lookup: >- {{ lookup( 'file', '/root/ansible_collections/community/mysql/tests/integration/db_engine_name' ) }} db_engine_version_lookup: >- {{ lookup( 'file', '/root/ansible_collections/community/mysql/tests/integration/db_engine_version' ) }} python_version_lookup: >- {{ lookup( 'file', '/root/ansible_collections/community/mysql/tests/integration/python' ) }} ansible_version_lookup: >- {{ lookup( 'file', '/root/ansible_collections/community/mysql/tests/integration/ansible' ) }} - name: "{{ role_name }} | Setvars | Set Fact using above facts" ansible.builtin.set_fact: db_engine: "{{ db_engine_name_lookup.strip() }}" db_version: "{{ db_engine_version_lookup.strip() }}" python_version: "{{ python_version_lookup.strip() }}" test_ansible_version: >- {%- if ansible_version_lookup == 'devel' -%} {{ ansible_version_lookup }} {%- else -%} {{ ansible_version_lookup.split('-')[1].strip() }} {%- endif -%} mysql_command: >- mysql -h{{ gateway_addr }} -P{{ mysql_primary_port }} -u{{ mysql_user }} -p{{ mysql_password }} --protocol=tcp mysql_command_wo_port: >- mysql -h{{ gateway_addr }} -u{{ mysql_user }} -p{{ mysql_password }} --protocol=tcp - name: "{{ role_name }} | Setvars | Output test informations" vars: msg: |- db_engine: {{ db_engine }} db_version: {{ db_version }} python_version: {{ python_version }} test_ansible_version: {{ test_ansible_version }} ansible.builtin.debug: msg: "{{ msg.split('\n') }}"