pytest-ansible==2.2.2 fails with not reachable logs
06shalini opened this issue · comments
Earlier i was seeing this Issues/28 and then I updated my pytest-ansible and ansible ,
- But Now I am facing below issue.
- My pytest execution hangs for really long time and fails saying host unreachable.
- My host is reachable without any password/ key. { ssh root@IP }
- Is there any setting I can do to avoid infinite connection check. This test passed once for me but the time of execution increased alot (+45mins)
Command:
- py.test --ansible-inventory hosts --user root --ansible-host-pattern master pytest/sanity/test_role_users_kra.py -q -s --junitxml role_user_creation_junit.xml -qsvv --debug
.
.
.
plugins: metadata-1.10.0, logger-0.3.0, html-1.22.1, autochecklog-0.2.0, ansible-2.2.2, ansible-playbook-0.3.0
collected 2 items
pytest/sanity/test_role_users_kra.py INFO - ------------------------------------------------------
INFO:Test:------------------------------------------------------
INFO - Func test_setup_kra_role_users in file: /root/pki-pytest-ansible/pytest/sanity/test_role_users_kra.py
INFO:Test:Func test_setup_kra_role_users in file: /root/pki-pytest-ansible/pytest/sanity/test_role_users_kra.py
Loading callback plugin unnamed of type old, v1.0 from /usr/lib/python2.7/site-packages/pytest_ansible/module_dispatcher/v28.py
META: ran handlers
<10.0.151.209> ESTABLISH SSH CONNECTION FOR USER: root
<10.0.151.209> SSH: ansible.cfg set ssh_args: (-C)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
<10.0.151.209> SSH: ansible_password/ansible_ssh_password not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
<10.0.151.209> SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User="root")
.
.
.
.
.
.
<10.0.151.209> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/af01c08f47 10.0.151.209 '/bin/sh -c '"'"'chmod u+x /root/.ansible/tmp/ansible-tmp-1596797381.57-70538618513074/ /root/.ansible/tmp/ansible-tmp-1596797381.57-70538618513074/AnsiballZ_command.py && sleep 0'"'"''
<10.0.151.209> (0, '', 'OpenSSH_7.7p1, OpenSSL 1.1.0h-fips 27 Mar 2018\r\ndebug1: Reading configuration data /root/.ssh/config\r\ndebug1: /root/.ssh/config line 1: Applying options for *\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug3: /etc/ssh/ssh_config line 52: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0\r\ndebug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf\r\ndebug3: /etc/ssh/ssh_config.d/05-redhat.conf line 2: Including file /etc/crypto-policies/back-ends/openssh.config depth 1\r\ndebug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config\r\ndebug3: gss kex names ok: [gss-gex-sha1-,gss-group14-sha1-]\r\ndebug3: kex names ok: [curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1]\r\ndebug1: /etc/ssh/ssh_config.d/05-redhat.conf line 8: Applying options for *\r\ndebug2: resolve_canonicalize: hostname 10.0.151.209 is address\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_client_request_alive: entering\r\ndebug3: mux_client_request_alive: done pid = 620\r\ndebug3: mux_client_request_session: session request sent\r\ndebug1: mux_client_request_session: master session id: 2\r\ndebug3: mux_client_read_packet: read header failed: Broken pipe\r\ndebug2: Received exit status from master 0\r\n')
<10.0.151.209> ESTABLISH SSH CONNECTION FOR USER: root
<10.0.151.209> SSH: ansible.cfg set ssh_args: (-C)(-o)(ControlMaster=auto)(-o)(ControlPersist=60s)
<10.0.151.209> SSH: ansible_password/ansible_ssh_password not set: (-o)(KbdInteractiveAuthentication=no)(-o)(PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey)(-o)(PasswordAuthentication=no)
<10.0.151.209> SSH: ANSIBLE_REMOTE_USER/remote_user/ansible_user/user/-u set: (-o)(User="root")
<10.0.151.209> SSH: ANSIBLE_TIMEOUT/timeout set: (-o)(ConnectTimeout=10)
<10.0.151.209> SSH: PlayContext set ssh_common_args: ()
<10.0.151.209> SSH: PlayContext set ssh_extra_args: ()
<10.0.151.209> SSH: found only ControlPersist; added ControlPath: (-o)(ControlPath=/root/.ansible/cp/af01c08f47)
<10.0.151.209> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="root"' -o ConnectTimeout=10 -o ControlPath=/root/.ansible/cp/af01c08f47 -tt 10.0.151.209 '/bin/sh -c '"'"'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1596797381.57-70538618513074/AnsiballZ_command.py && sleep 0'"'"''
Versions used:
ansible==2.8.0
pytest==3.6.3
pytest-ansible==2.2.2
pytest-ansible-playbook==0.3.0
pytest-autochecklog==0.2.0
pytest-html==1.22.1
pytest-logger==0.3.0
pytest-metadata==1.10.0
your pytest looks quite old. I think it would be good to try and get a simple reproducer with pytest<6.0.0 (e.g. latest 5.x release) and also ansible 2.9.15 would be good.
for what its worth, I know nothing about https://gitlab.com/mbukatov/pytest-ansible-playbook