diff --git a/tests/integration/targets/generic_ssh_connection/tasks/main.yml b/tests/integration/targets/generic_ssh_connection/tasks/main.yml index 0d03f80ec..e95219b78 100644 --- a/tests/integration/targets/generic_ssh_connection/tasks/main.yml +++ b/tests/integration/targets/generic_ssh_connection/tasks/main.yml @@ -11,12 +11,12 @@ - name: Make sure we got information assert: that: - - 'output.host_info.Name is string' - - 'output.containers is not defined' - - 'output.networks is not defined' - - 'output.volumes is not defined' - - 'output.images is not defined' - - 'output.disk_usage is not defined' + - 'output.host_info.Name is string' + - 'output.containers is not defined' + - 'output.networks is not defined' + - 'output.volumes is not defined' + - 'output.images is not defined' + - 'output.disk_usage is not defined' - name: Show contents of ~/.ssh command: ls -lah ~/.ssh @@ -40,28 +40,36 @@ - name: Make sure we got information assert: that: - - 'output.host_info.Name is string' - - 'output.containers is not defined' - - 'output.networks is not defined' - - 'output.volumes is not defined' - - 'output.images is not defined' - - 'output.disk_usage is not defined' - when: output is not failed or 'Install paramiko package to enable' in output.msg + - 'output.host_info.Name is string' + - 'output.containers is not defined' + - 'output.networks is not defined' + - 'output.volumes is not defined' + - 'output.images is not defined' + - 'output.disk_usage is not defined' + when: output is succeeded or 'Install paramiko package to enable' in output.msg -- when: docker_py_version is version('4.4.0', '>=') - block: - - name: Get docker daemon information via ssh (OpenSSH) to localhost - docker_host_info: - docker_host: "ssh://root@localhost" - use_ssh_client: true - register: output +- name: Get docker daemon information via ssh (OpenSSH) to localhost + docker_host_info: + docker_host: "ssh://root@localhost" + use_ssh_client: true + register: output + ignore_errors: true - - name: Make sure we got information - assert: - that: - - 'output.host_info.Name is string' - - 'output.containers is not defined' - - 'output.networks is not defined' - - 'output.volumes is not defined' - - 'output.images is not defined' - - 'output.disk_usage is not defined' +- name: Make sure we got information + assert: + that: + - output is succeeded + - 'output.host_info.Name is string' + - 'output.containers is not defined' + - 'output.networks is not defined' + - 'output.volumes is not defined' + - 'output.images is not defined' + - 'output.disk_usage is not defined' + when: docker_py_version is version('4.4.0', '>=') + +- name: Make sure we got information + assert: + that: + - output is failed + - "'use_ssh_client=True requires Docker SDK for Python 4.4.0 or newer' in output.msg" + when: docker_py_version is version('4.4.0', '<')