Ansible Playbook running locally but unable to ssh to host via AWXHow do you manage ssh keys to add a second user?ssh_exchange_identification: Connection closed by remote hostSSH accepts publickey authetication but won't connect with an identify file?OpenSSH disable ControlMaster for given hostnameAnsible Fails to Authenticate Sudo Even When Sudo Pass is GivenAnsible with Github: Permission denied (Publickey)Ansible can't git clone from enterprise git serverAd-hoc ansible command with vaultAnsible AWX playbooks pulled from github do not show in playbook drop-down box

Why doesn't a particle exert force on itself?

Can you turn a recording upside-down?

My parents are Afghan

What are my options legally if NYC company is not paying salary?

Why does this pattern in powers happen?

Do oversize pulley wheels increase derailleur capacity?

Is there an application which does HTTP PUT?

Capturing the entire webpage with WebExecute's CaptureImage

Are there vaccine ingredients which may not be disclosed ("hidden", "trade secret", or similar)?

Why doesn't increasing the temperature of something like wood or paper set them on fire?

Is there a reason why Turkey took the Balkan territories of the Ottoman Empire, instead of Greece or another of the Balkan states?

Opposite party turned away from voting when ballot is all opposing party

why it is 2>&1 and not 2>>&1 to append to a log file

How can it be that ssh somename works, while nslookup somename does not?

Steganography in Latex

Can the president of the United States be guilty of insider trading?

Program for finding longest run of zeros from a list of 100 random integers which are either 0 or 1

Should one save up to purchase a house/condo or maximize their 401(k) first?

My perfect evil overlord plan... or is it?

Was Mohammed the most popular first name for boys born in Berlin in 2018?

Gift for mentor after his thesis defense?

Why is it wrong to *implement* myself a known, published, widely believed to be secure crypto algorithm?

Names of the Six Tastes

Add elements inside Array conditionally in JavaScript



Ansible Playbook running locally but unable to ssh to host via AWX


How do you manage ssh keys to add a second user?ssh_exchange_identification: Connection closed by remote hostSSH accepts publickey authetication but won't connect with an identify file?OpenSSH disable ControlMaster for given hostnameAnsible Fails to Authenticate Sudo Even When Sudo Pass is GivenAnsible with Github: Permission denied (Publickey)Ansible can't git clone from enterprise git serverAd-hoc ansible command with vaultAnsible AWX playbooks pulled from github do not show in playbook drop-down box






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








2















SUMMARY



I have ansible and ansible AWX installed on same AWS EC2 instance and I am trying to deploy build on another app AWS EC2 instance. I am able to run the playbook via ansible-playbook command,however, get Failed to connect to the host via ssh when using AWX



  • AWX inventory has just that host added along with ansible_user :
    xxxxx which is the user I want to deploy with

  • Ansible/AWX host has the xxxxx user setup with password less access to the target host which also has the same user (public keys copied)

  • I also tried creating this user in aws_task and aws_web containers and copied the public keys to target host


  • Running the ssh command AWS runs while gathering information fails




    ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=xxxxx -o ConnectTimeout=10 -o ControlPath=/tmp/awx_108_dKOwxm/cp/61735cd9d3 hostname '/bin/sh -c '"'"'echo ~xxxxx && sleep 0'"'"''




Output:



debug3: muxserver_listen: temporary control path /tmp/awx_72_VGFOPt/cp/61735cd9d3.16cjnTwr0hSE1mXc
bind: No such file or directory
unix_listener: cannot bind to path: /tmp/awx_72_VGFOPt/cp/61735cd9d3.16cjnTwr0hSE1mXc



  • Running the command after leaving some configuration options - ControlPersist,ControlMaster,ssh works -




    ssh -vvv -C -o StrictHostKeyChecking=no -o 'IdentityFile="/home/xxxxx/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=xxxxx -o ConnectTimeout=10 hostname




Questions



  1. Is this a permission issue while creating the ControlPath? The aws_web and aws_task container both have /tmp folder with 777 permission

  2. Which configuration (ansible.cfg) does AWX pick - from the aws_task/aws_web containers or from the host on which it is deployed. I have also tried to set ssh_args = -C (removing the ControlMaster and ControlPersist) at all the three places in ansible.cfg and restarted the AWS containers, without any luck

  3. Why it is not working with Control Params

Additional Information



Ansible Version



ansible 2.7.1
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /bin/ansible
python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]


Configuration



ANSIBLE_SSH_ARGS(/etc/ansible/ansible.cfg) = -C


OS / ENVIRONMENT



Ansible and AWX host OS -> CentOS Linux release 7.5.1804 (Core)



Target host OS -> CentOS Linux release 7.5.1804 (Core)



AWX Version: 2.1.0



AWX installed via -> https://github.com/ansible/awx/blob/devel/INSTALL.md#docker-or-docker-compose



STEPS TO REPRODUCE



1) Created Project in AWX with SCM type git.



2) Created inventory in AWX adding the host with variable ansible_user: xxxxx



3) Created job template specifying job type run and selecting project and inventory created in 1 and 2. Provided the extra variable build: in the template as required in the playbook



PlayBook



https://github.com/sandeepdharembra/playbooks/blob/master/installnodejs.yml



ACTUAL RESULTS while running the job template



ansible-playbook 2.7.1
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/var/lib/awx/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /usr/lib/python2.7/site-packages/ansible
executable location = /usr/bin/ansible-playbook
python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
Using /etc/ansible/ansible.cfg as config file
setting up inventory plugins
Parsed /tmp/awx_108_dKOwxm/tmpo_yCMg inventory source with script plugin
Loading callback plugin awx_display of type stdout, v2.0 from /usr/lib/python2.7/site-packages/awx/lib/awx_display_callback/module.pyc
1 plays in installnodejs.yml
PLAY [all] *********************************************************************
META: ran handlers
TASK [Created new build directory] *********************************************
task path: /var/lib/awx/projects/_6__festaging/installnodejs.yml:10
<hostname> ESTABLISH SSH CONNECTION FOR USER: xxxxx
<hostname> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=xxxxx -o ConnectTimeout=10 -o ControlPath=/tmp/awx_108_dKOwxm/cp/61735cd9d3 hostname '/bin/sh -c '"'"'echo ~xxxxx && sleep 0'"'"''
<hostname> (255, '', 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug1: Control socket "/tmp/awx_108_dKOwxm/cp/61735cd9d3" does not existrndebug2: resolving "hostname" port 22rndebug2: ssh_connect_direct: needpriv 0rndebug1: Connecting to hostname [hostname] port 22.rndebug2: fd 3 setting O_NONBLOCKrndebug1: fd 3 clearing O_NONBLOCKrndebug1: Connection established.rndebug3: timeout: 9997 ms remain after connectrndebug1: permanently_set_uid: 0/0rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_rsa type -1rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_rsa-cert type -1rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_dsa type -1rndeb…
fatal: [hostname]: UNREACHABLE! => {
"changed": false,
"msg": "Failed to connect to the host via ssh: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug1: Control socket "/tmp/awx_108_dKOwxm/cp/61735cd9d3" does not existrndebug2: resolving "hostname" port 22rndebug2: ssh_connect_direct: needpriv 0rndebug1: Connecting to hostname [172.16.5.91] port 22.rndebug2: fd 3 setting O_NONBLOCKrndebug1: fd 3 clearing O_NONBLOCKrndebug1: Connection established.rndebug3: timeout: 9997 ms remain after connectrndebug1: permanently_set_uid: 0/0rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_rsa type -1rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_rsa-cert ty…
PLAY RECAP *********************************************************************
hostname : ok=0 changed=0 unreachable=1 failed=0









share|improve this question






























    2















    SUMMARY



    I have ansible and ansible AWX installed on same AWS EC2 instance and I am trying to deploy build on another app AWS EC2 instance. I am able to run the playbook via ansible-playbook command,however, get Failed to connect to the host via ssh when using AWX



    • AWX inventory has just that host added along with ansible_user :
      xxxxx which is the user I want to deploy with

    • Ansible/AWX host has the xxxxx user setup with password less access to the target host which also has the same user (public keys copied)

    • I also tried creating this user in aws_task and aws_web containers and copied the public keys to target host


    • Running the ssh command AWS runs while gathering information fails




      ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=xxxxx -o ConnectTimeout=10 -o ControlPath=/tmp/awx_108_dKOwxm/cp/61735cd9d3 hostname '/bin/sh -c '"'"'echo ~xxxxx && sleep 0'"'"''




    Output:



    debug3: muxserver_listen: temporary control path /tmp/awx_72_VGFOPt/cp/61735cd9d3.16cjnTwr0hSE1mXc
    bind: No such file or directory
    unix_listener: cannot bind to path: /tmp/awx_72_VGFOPt/cp/61735cd9d3.16cjnTwr0hSE1mXc



    • Running the command after leaving some configuration options - ControlPersist,ControlMaster,ssh works -




      ssh -vvv -C -o StrictHostKeyChecking=no -o 'IdentityFile="/home/xxxxx/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=xxxxx -o ConnectTimeout=10 hostname




    Questions



    1. Is this a permission issue while creating the ControlPath? The aws_web and aws_task container both have /tmp folder with 777 permission

    2. Which configuration (ansible.cfg) does AWX pick - from the aws_task/aws_web containers or from the host on which it is deployed. I have also tried to set ssh_args = -C (removing the ControlMaster and ControlPersist) at all the three places in ansible.cfg and restarted the AWS containers, without any luck

    3. Why it is not working with Control Params

    Additional Information



    Ansible Version



    ansible 2.7.1
    config file = /etc/ansible/ansible.cfg
    configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
    ansible python module location = /usr/lib/python2.7/site-packages/ansible
    executable location = /bin/ansible
    python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]


    Configuration



    ANSIBLE_SSH_ARGS(/etc/ansible/ansible.cfg) = -C


    OS / ENVIRONMENT



    Ansible and AWX host OS -> CentOS Linux release 7.5.1804 (Core)



    Target host OS -> CentOS Linux release 7.5.1804 (Core)



    AWX Version: 2.1.0



    AWX installed via -> https://github.com/ansible/awx/blob/devel/INSTALL.md#docker-or-docker-compose



    STEPS TO REPRODUCE



    1) Created Project in AWX with SCM type git.



    2) Created inventory in AWX adding the host with variable ansible_user: xxxxx



    3) Created job template specifying job type run and selecting project and inventory created in 1 and 2. Provided the extra variable build: in the template as required in the playbook



    PlayBook



    https://github.com/sandeepdharembra/playbooks/blob/master/installnodejs.yml



    ACTUAL RESULTS while running the job template



    ansible-playbook 2.7.1
    config file = /etc/ansible/ansible.cfg
    configured module search path = [u'/var/lib/awx/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
    ansible python module location = /usr/lib/python2.7/site-packages/ansible
    executable location = /usr/bin/ansible-playbook
    python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
    Using /etc/ansible/ansible.cfg as config file
    setting up inventory plugins
    Parsed /tmp/awx_108_dKOwxm/tmpo_yCMg inventory source with script plugin
    Loading callback plugin awx_display of type stdout, v2.0 from /usr/lib/python2.7/site-packages/awx/lib/awx_display_callback/module.pyc
    1 plays in installnodejs.yml
    PLAY [all] *********************************************************************
    META: ran handlers
    TASK [Created new build directory] *********************************************
    task path: /var/lib/awx/projects/_6__festaging/installnodejs.yml:10
    <hostname> ESTABLISH SSH CONNECTION FOR USER: xxxxx
    <hostname> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=xxxxx -o ConnectTimeout=10 -o ControlPath=/tmp/awx_108_dKOwxm/cp/61735cd9d3 hostname '/bin/sh -c '"'"'echo ~xxxxx && sleep 0'"'"''
    <hostname> (255, '', 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug1: Control socket "/tmp/awx_108_dKOwxm/cp/61735cd9d3" does not existrndebug2: resolving "hostname" port 22rndebug2: ssh_connect_direct: needpriv 0rndebug1: Connecting to hostname [hostname] port 22.rndebug2: fd 3 setting O_NONBLOCKrndebug1: fd 3 clearing O_NONBLOCKrndebug1: Connection established.rndebug3: timeout: 9997 ms remain after connectrndebug1: permanently_set_uid: 0/0rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_rsa type -1rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_rsa-cert type -1rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_dsa type -1rndeb…
    fatal: [hostname]: UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug1: Control socket "/tmp/awx_108_dKOwxm/cp/61735cd9d3" does not existrndebug2: resolving "hostname" port 22rndebug2: ssh_connect_direct: needpriv 0rndebug1: Connecting to hostname [172.16.5.91] port 22.rndebug2: fd 3 setting O_NONBLOCKrndebug1: fd 3 clearing O_NONBLOCKrndebug1: Connection established.rndebug3: timeout: 9997 ms remain after connectrndebug1: permanently_set_uid: 0/0rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_rsa type -1rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_rsa-cert ty…
    PLAY RECAP *********************************************************************
    hostname : ok=0 changed=0 unreachable=1 failed=0









    share|improve this question


























      2












      2








      2








      SUMMARY



      I have ansible and ansible AWX installed on same AWS EC2 instance and I am trying to deploy build on another app AWS EC2 instance. I am able to run the playbook via ansible-playbook command,however, get Failed to connect to the host via ssh when using AWX



      • AWX inventory has just that host added along with ansible_user :
        xxxxx which is the user I want to deploy with

      • Ansible/AWX host has the xxxxx user setup with password less access to the target host which also has the same user (public keys copied)

      • I also tried creating this user in aws_task and aws_web containers and copied the public keys to target host


      • Running the ssh command AWS runs while gathering information fails




        ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=xxxxx -o ConnectTimeout=10 -o ControlPath=/tmp/awx_108_dKOwxm/cp/61735cd9d3 hostname '/bin/sh -c '"'"'echo ~xxxxx && sleep 0'"'"''




      Output:



      debug3: muxserver_listen: temporary control path /tmp/awx_72_VGFOPt/cp/61735cd9d3.16cjnTwr0hSE1mXc
      bind: No such file or directory
      unix_listener: cannot bind to path: /tmp/awx_72_VGFOPt/cp/61735cd9d3.16cjnTwr0hSE1mXc



      • Running the command after leaving some configuration options - ControlPersist,ControlMaster,ssh works -




        ssh -vvv -C -o StrictHostKeyChecking=no -o 'IdentityFile="/home/xxxxx/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=xxxxx -o ConnectTimeout=10 hostname




      Questions



      1. Is this a permission issue while creating the ControlPath? The aws_web and aws_task container both have /tmp folder with 777 permission

      2. Which configuration (ansible.cfg) does AWX pick - from the aws_task/aws_web containers or from the host on which it is deployed. I have also tried to set ssh_args = -C (removing the ControlMaster and ControlPersist) at all the three places in ansible.cfg and restarted the AWS containers, without any luck

      3. Why it is not working with Control Params

      Additional Information



      Ansible Version



      ansible 2.7.1
      config file = /etc/ansible/ansible.cfg
      configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
      ansible python module location = /usr/lib/python2.7/site-packages/ansible
      executable location = /bin/ansible
      python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]


      Configuration



      ANSIBLE_SSH_ARGS(/etc/ansible/ansible.cfg) = -C


      OS / ENVIRONMENT



      Ansible and AWX host OS -> CentOS Linux release 7.5.1804 (Core)



      Target host OS -> CentOS Linux release 7.5.1804 (Core)



      AWX Version: 2.1.0



      AWX installed via -> https://github.com/ansible/awx/blob/devel/INSTALL.md#docker-or-docker-compose



      STEPS TO REPRODUCE



      1) Created Project in AWX with SCM type git.



      2) Created inventory in AWX adding the host with variable ansible_user: xxxxx



      3) Created job template specifying job type run and selecting project and inventory created in 1 and 2. Provided the extra variable build: in the template as required in the playbook



      PlayBook



      https://github.com/sandeepdharembra/playbooks/blob/master/installnodejs.yml



      ACTUAL RESULTS while running the job template



      ansible-playbook 2.7.1
      config file = /etc/ansible/ansible.cfg
      configured module search path = [u'/var/lib/awx/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
      ansible python module location = /usr/lib/python2.7/site-packages/ansible
      executable location = /usr/bin/ansible-playbook
      python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
      Using /etc/ansible/ansible.cfg as config file
      setting up inventory plugins
      Parsed /tmp/awx_108_dKOwxm/tmpo_yCMg inventory source with script plugin
      Loading callback plugin awx_display of type stdout, v2.0 from /usr/lib/python2.7/site-packages/awx/lib/awx_display_callback/module.pyc
      1 plays in installnodejs.yml
      PLAY [all] *********************************************************************
      META: ran handlers
      TASK [Created new build directory] *********************************************
      task path: /var/lib/awx/projects/_6__festaging/installnodejs.yml:10
      <hostname> ESTABLISH SSH CONNECTION FOR USER: xxxxx
      <hostname> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=xxxxx -o ConnectTimeout=10 -o ControlPath=/tmp/awx_108_dKOwxm/cp/61735cd9d3 hostname '/bin/sh -c '"'"'echo ~xxxxx && sleep 0'"'"''
      <hostname> (255, '', 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug1: Control socket "/tmp/awx_108_dKOwxm/cp/61735cd9d3" does not existrndebug2: resolving "hostname" port 22rndebug2: ssh_connect_direct: needpriv 0rndebug1: Connecting to hostname [hostname] port 22.rndebug2: fd 3 setting O_NONBLOCKrndebug1: fd 3 clearing O_NONBLOCKrndebug1: Connection established.rndebug3: timeout: 9997 ms remain after connectrndebug1: permanently_set_uid: 0/0rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_rsa type -1rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_rsa-cert type -1rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_dsa type -1rndeb…
      fatal: [hostname]: UNREACHABLE! => {
      "changed": false,
      "msg": "Failed to connect to the host via ssh: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug1: Control socket "/tmp/awx_108_dKOwxm/cp/61735cd9d3" does not existrndebug2: resolving "hostname" port 22rndebug2: ssh_connect_direct: needpriv 0rndebug1: Connecting to hostname [172.16.5.91] port 22.rndebug2: fd 3 setting O_NONBLOCKrndebug1: fd 3 clearing O_NONBLOCKrndebug1: Connection established.rndebug3: timeout: 9997 ms remain after connectrndebug1: permanently_set_uid: 0/0rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_rsa type -1rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_rsa-cert ty…
      PLAY RECAP *********************************************************************
      hostname : ok=0 changed=0 unreachable=1 failed=0









      share|improve this question
















      SUMMARY



      I have ansible and ansible AWX installed on same AWS EC2 instance and I am trying to deploy build on another app AWS EC2 instance. I am able to run the playbook via ansible-playbook command,however, get Failed to connect to the host via ssh when using AWX



      • AWX inventory has just that host added along with ansible_user :
        xxxxx which is the user I want to deploy with

      • Ansible/AWX host has the xxxxx user setup with password less access to the target host which also has the same user (public keys copied)

      • I also tried creating this user in aws_task and aws_web containers and copied the public keys to target host


      • Running the ssh command AWS runs while gathering information fails




        ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=xxxxx -o ConnectTimeout=10 -o ControlPath=/tmp/awx_108_dKOwxm/cp/61735cd9d3 hostname '/bin/sh -c '"'"'echo ~xxxxx && sleep 0'"'"''




      Output:



      debug3: muxserver_listen: temporary control path /tmp/awx_72_VGFOPt/cp/61735cd9d3.16cjnTwr0hSE1mXc
      bind: No such file or directory
      unix_listener: cannot bind to path: /tmp/awx_72_VGFOPt/cp/61735cd9d3.16cjnTwr0hSE1mXc



      • Running the command after leaving some configuration options - ControlPersist,ControlMaster,ssh works -




        ssh -vvv -C -o StrictHostKeyChecking=no -o 'IdentityFile="/home/xxxxx/.ssh/id_rsa"' -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=xxxxx -o ConnectTimeout=10 hostname




      Questions



      1. Is this a permission issue while creating the ControlPath? The aws_web and aws_task container both have /tmp folder with 777 permission

      2. Which configuration (ansible.cfg) does AWX pick - from the aws_task/aws_web containers or from the host on which it is deployed. I have also tried to set ssh_args = -C (removing the ControlMaster and ControlPersist) at all the three places in ansible.cfg and restarted the AWS containers, without any luck

      3. Why it is not working with Control Params

      Additional Information



      Ansible Version



      ansible 2.7.1
      config file = /etc/ansible/ansible.cfg
      configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
      ansible python module location = /usr/lib/python2.7/site-packages/ansible
      executable location = /bin/ansible
      python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]


      Configuration



      ANSIBLE_SSH_ARGS(/etc/ansible/ansible.cfg) = -C


      OS / ENVIRONMENT



      Ansible and AWX host OS -> CentOS Linux release 7.5.1804 (Core)



      Target host OS -> CentOS Linux release 7.5.1804 (Core)



      AWX Version: 2.1.0



      AWX installed via -> https://github.com/ansible/awx/blob/devel/INSTALL.md#docker-or-docker-compose



      STEPS TO REPRODUCE



      1) Created Project in AWX with SCM type git.



      2) Created inventory in AWX adding the host with variable ansible_user: xxxxx



      3) Created job template specifying job type run and selecting project and inventory created in 1 and 2. Provided the extra variable build: in the template as required in the playbook



      PlayBook



      https://github.com/sandeepdharembra/playbooks/blob/master/installnodejs.yml



      ACTUAL RESULTS while running the job template



      ansible-playbook 2.7.1
      config file = /etc/ansible/ansible.cfg
      configured module search path = [u'/var/lib/awx/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
      ansible python module location = /usr/lib/python2.7/site-packages/ansible
      executable location = /usr/bin/ansible-playbook
      python version = 2.7.5 (default, Jul 13 2018, 13:06:57) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
      Using /etc/ansible/ansible.cfg as config file
      setting up inventory plugins
      Parsed /tmp/awx_108_dKOwxm/tmpo_yCMg inventory source with script plugin
      Loading callback plugin awx_display of type stdout, v2.0 from /usr/lib/python2.7/site-packages/awx/lib/awx_display_callback/module.pyc
      1 plays in installnodejs.yml
      PLAY [all] *********************************************************************
      META: ran handlers
      TASK [Created new build directory] *********************************************
      task path: /var/lib/awx/projects/_6__festaging/installnodejs.yml:10
      <hostname> ESTABLISH SSH CONNECTION FOR USER: xxxxx
      <hostname> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o StrictHostKeyChecking=no -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=xxxxx -o ConnectTimeout=10 -o ControlPath=/tmp/awx_108_dKOwxm/cp/61735cd9d3 hostname '/bin/sh -c '"'"'echo ~xxxxx && sleep 0'"'"''
      <hostname> (255, '', 'OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug1: Control socket "/tmp/awx_108_dKOwxm/cp/61735cd9d3" does not existrndebug2: resolving "hostname" port 22rndebug2: ssh_connect_direct: needpriv 0rndebug1: Connecting to hostname [hostname] port 22.rndebug2: fd 3 setting O_NONBLOCKrndebug1: fd 3 clearing O_NONBLOCKrndebug1: Connection established.rndebug3: timeout: 9997 ms remain after connectrndebug1: permanently_set_uid: 0/0rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_rsa type -1rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_rsa-cert type -1rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_dsa type -1rndeb…
      fatal: [hostname]: UNREACHABLE! => {
      "changed": false,
      "msg": "Failed to connect to the host via ssh: OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017rndebug1: Reading configuration data /etc/ssh/ssh_configrndebug1: /etc/ssh/ssh_config line 58: Applying options for *rndebug1: auto-mux: Trying existing masterrndebug1: Control socket "/tmp/awx_108_dKOwxm/cp/61735cd9d3" does not existrndebug2: resolving "hostname" port 22rndebug2: ssh_connect_direct: needpriv 0rndebug1: Connecting to hostname [172.16.5.91] port 22.rndebug2: fd 3 setting O_NONBLOCKrndebug1: fd 3 clearing O_NONBLOCKrndebug1: Connection established.rndebug3: timeout: 9997 ms remain after connectrndebug1: permanently_set_uid: 0/0rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_rsa type -1rndebug1: key_load_public: No such file or directoryrndebug1: identity file /root/.ssh/id_rsa-cert ty…
      PLAY RECAP *********************************************************************
      hostname : ok=0 changed=0 unreachable=1 failed=0






      ssh ansible ansible-tower






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 29 '18 at 6:13







      Sandeep Dharembra

















      asked Nov 29 '18 at 3:36









      Sandeep DharembraSandeep Dharembra

      365




      365




















          1 Answer
          1






          active

          oldest

          votes


















          0














          I was finally able to find a solution to this issue -



          The job template I created had the credentials not assigned. I created the credentials with which I wanted to access the target host (user present on target host), assigned the private key and added these credentials to the job template.
          Job was now able to run (ssh on the remote host)






          share|improve this answer























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "2"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f942092%2fansible-playbook-running-locally-but-unable-to-ssh-to-host-via-awx%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I was finally able to find a solution to this issue -



            The job template I created had the credentials not assigned. I created the credentials with which I wanted to access the target host (user present on target host), assigned the private key and added these credentials to the job template.
            Job was now able to run (ssh on the remote host)






            share|improve this answer



























              0














              I was finally able to find a solution to this issue -



              The job template I created had the credentials not assigned. I created the credentials with which I wanted to access the target host (user present on target host), assigned the private key and added these credentials to the job template.
              Job was now able to run (ssh on the remote host)






              share|improve this answer

























                0












                0








                0







                I was finally able to find a solution to this issue -



                The job template I created had the credentials not assigned. I created the credentials with which I wanted to access the target host (user present on target host), assigned the private key and added these credentials to the job template.
                Job was now able to run (ssh on the remote host)






                share|improve this answer













                I was finally able to find a solution to this issue -



                The job template I created had the credentials not assigned. I created the credentials with which I wanted to access the target host (user present on target host), assigned the private key and added these credentials to the job template.
                Job was now able to run (ssh on the remote host)







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 30 '18 at 6:50









                Sandeep DharembraSandeep Dharembra

                365




                365



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Server Fault!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f942092%2fansible-playbook-running-locally-but-unable-to-ssh-to-host-via-awx%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

                    Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

                    Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020