--- - name: "{{ role_name }} | Setvars | Extract Podman/Docker Network Gateway" ansible.builtin.shell: cmd: ip route|grep default|awk '{print $3}' register: ip_route_output - name: "{{ role_name }} | Setvars | Set Fact" ansible.builtin.set_fact: gateway_addr: "{{ ip_route_output.stdout }}" connector_name_version: >- {{ lookup( 'file', '/root/ansible_collections/community/mysql/tests/integration/connector' ) }} db_engine_version: >- {{ 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: connector_name: "{{ connector_name_version.split('=')[0].strip() }}" connector_version: "{{ connector_name_version.split('=')[2].strip() }}" db_engine: "{{ db_engine_version.split(':')[0].strip() }}" db_version: "{{ db_engine_version.split(':')[1].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: |- connector_name: {{ connector_name }} connector_version: {{ connector_version }} 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') }}"