Closed Elyytscha closed 5 years ago
im trying to provision hosts like:
- name: Ensure Host is here and running foreman_host: name: "{{ ansible_host }}" state: present compute_resource: VMwareCluster01 hostgroup: Hostgroup01 provision_method: build
but it throws error, because ansible can't reach those hosts (logically, they aren't created yet'), how should that work?:
TASK [company.foreman : Ensure Host is here and running] ******************************************************************************************************************************************************************* task path: /home/erami/Devel/docker/docker-activemq/ansible/roles/company/company.foreman/tasks/provision.yml:17 <activemq71.test.lx.company.at> ESTABLISH SSH CONNECTION FOR USER: root <activemq71.test.lx.company.at> 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=/home/erami/.ansible/cp/8381d57848 activemq71.test.lx.company.at '/bin/sh -c '"'"'echo ~root && sleep 0'"'"'' <activemq71.test.lx.company.at> (255, '', 'OpenSSH_7.9p1 Ubuntu-10, OpenSSL 1.1.1b 26 Feb 2019\r\ndebug1: Reading configuration data /home/erami/.ssh/config\r\ndebug1: /home/erami/.ssh/config line 4: Applying options for *.*.lx.company.at\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket "/home/erami/.ansible/cp/8381d57848" does not exist\r\ndebug1: Executing proxy command: exec ssh -o \'ForwardAgent yes\' norfair \'ssh-add ~/.ssh/id_rsa && nc activemq71.test.lx.company.at 22\'\r\ndebug3: timeout: 10000 ms remain after connect\r\ndebug1: identity file /home/erami/.ssh/id_rsa type 0\r\ndebug1: identity file /home/erami/.ssh/id_rsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_dsa type -1\r\ndebug1: identity file /home/erami/.ssh/id_dsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_ecdsa type -1\r\ndebug1: identity file /home/erami/.ssh/id_ecdsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_ed25519 type -1\r\ndebug1: identity file /home/erami/.ssh/id_ed25519-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_xmss type -1\r\ndebug1: identity file /home/erami/.ssh/id_xmss-cert type -1\r\ndebug1: Local version string SSH-2.0-OpenSSH_7.9p1 Ubuntu-10\r\nIdentity added: /home/local/company/user/.ssh/id_rsa (/home/local/company/user/.ssh/id_rsa)\nnc: getaddrinfo: Name or service not known\nssh_exchange_identification: Connection closed by remote host\r\n') fatal: [activemq71.test.lx.company.at]: UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: OpenSSH_7.9p1 Ubuntu-10, OpenSSL 1.1.1b 26 Feb 2019\r\ndebug1: Reading configuration data /home/erami/.ssh/config\r\ndebug1: /home/erami/.ssh/config line 4: Applying options for *.*.lx.company.at\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket \"/home/erami/.ansible/cp/8381d57848\" does not exist\r\ndebug1: Executing proxy command: exec ssh -o 'ForwardAgent yes' norfair 'ssh-add ~/.ssh/id_rsa && nc activemq71.test.lx.company.at 22'\r\ndebug3: timeout: 10000 ms remain after connect\r\ndebug1: identity file /home/erami/.ssh/id_rsa type 0\r\ndebug1: identity file /home/erami/.ssh/id_rsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_dsa type -1\r\ndebug1: identity file /home/erami/.ssh/id_dsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_ecdsa type -1\r\ndebug1: identity file /home/erami/.ssh/id_ecdsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_ed25519 type -1\r\ndebug1: identity file /home/erami/.ssh/id_ed25519-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_xmss type -1\r\ndebug1: identity file /home/erami/.ssh/id_xmss-cert type -1\r\ndebug1: Local version string SSH-2.0-OpenSSH_7.9p1 Ubuntu-10\r\nIdentity added: /home/local/company/user/.ssh/id_rsa (/home/local/company/user/.ssh/id_rsa)\nnc: getaddrinfo: Name or service not known\nssh_exchange_identification: Connection closed by remote host", "unreachable": true } <activemq72.test.lx.company.at> ESTABLISH SSH CONNECTION FOR USER: root <activemq72.test.lx.company.at> 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=/home/erami/.ansible/cp/0d3d505307 activemq72.test.lx.company.at '/bin/sh -c '"'"'echo ~root && sleep 0'"'"'' <activemq72.test.lx.company.at> (255, '', 'OpenSSH_7.9p1 Ubuntu-10, OpenSSL 1.1.1b 26 Feb 2019\r\ndebug1: Reading configuration data /home/erami/.ssh/config\r\ndebug1: /home/erami/.ssh/config line 4: Applying options for *.*.lx.company.at\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket "/home/erami/.ansible/cp/0d3d505307" does not exist\r\ndebug1: Executing proxy command: exec ssh -o \'ForwardAgent yes\' norfair \'ssh-add ~/.ssh/id_rsa && nc activemq72.test.lx.company.at 22\'\r\ndebug3: timeout: 10000 ms remain after connect\r\ndebug1: identity file /home/erami/.ssh/id_rsa type 0\r\ndebug1: identity file /home/erami/.ssh/id_rsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_dsa type -1\r\ndebug1: identity file /home/erami/.ssh/id_dsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_ecdsa type -1\r\ndebug1: identity file /home/erami/.ssh/id_ecdsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_ed25519 type -1\r\ndebug1: identity file /home/erami/.ssh/id_ed25519-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_xmss type -1\r\ndebug1: identity file /home/erami/.ssh/id_xmss-cert type -1\r\ndebug1: Local version string SSH-2.0-OpenSSH_7.9p1 Ubuntu-10\r\nIdentity added: /home/local/company/user/.ssh/id_rsa (/home/local/company/user/.ssh/id_rsa)\nnc: getaddrinfo: Name or service not known\nssh_exchange_identification: Connection closed by remote host\r\n') fatal: [activemq72.test.lx.company.at]: UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: OpenSSH_7.9p1 Ubuntu-10, OpenSSL 1.1.1b 26 Feb 2019\r\ndebug1: Reading configuration data /home/erami/.ssh/config\r\ndebug1: /home/erami/.ssh/config line 4: Applying options for *.*.lx.company.at\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket \"/home/erami/.ansible/cp/0d3d505307\" does not exist\r\ndebug1: Executing proxy command: exec ssh -o 'ForwardAgent yes' norfair 'ssh-add ~/.ssh/id_rsa && nc activemq72.test.lx.company.at 22'\r\ndebug3: timeout: 10000 ms remain after connect\r\ndebug1: identity file /home/erami/.ssh/id_rsa type 0\r\ndebug1: identity file /home/erami/.ssh/id_rsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_dsa type -1\r\ndebug1: identity file /home/erami/.ssh/id_dsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_ecdsa type -1\r\ndebug1: identity file /home/erami/.ssh/id_ecdsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_ed25519 type -1\r\ndebug1: identity file /home/erami/.ssh/id_ed25519-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_xmss type -1\r\ndebug1: identity file /home/erami/.ssh/id_xmss-cert type -1\r\ndebug1: Local version string SSH-2.0-OpenSSH_7.9p1 Ubuntu-10\r\nIdentity added: /home/local/company/user/.ssh/id_rsa (/home/local/company/user/.ssh/id_rsa)\nnc: getaddrinfo: Name or service not known\nssh_exchange_identification: Connection closed by remote host", "unreachable": true } <activemq73.test.lx.company.at> ESTABLISH SSH CONNECTION FOR USER: root <activemq73.test.lx.company.at> 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=/home/erami/.ansible/cp/62f9ffd3e1 activemq73.test.lx.company.at '/bin/sh -c '"'"'echo ~root && sleep 0'"'"'' <activemq73.test.lx.company.at> (255, '', 'OpenSSH_7.9p1 Ubuntu-10, OpenSSL 1.1.1b 26 Feb 2019\r\ndebug1: Reading configuration data /home/erami/.ssh/config\r\ndebug1: /home/erami/.ssh/config line 4: Applying options for *.*.lx.company.at\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket "/home/erami/.ansible/cp/62f9ffd3e1" does not exist\r\ndebug1: Executing proxy command: exec ssh -o \'ForwardAgent yes\' norfair \'ssh-add ~/.ssh/id_rsa && nc activemq73.test.lx.company.at 22\'\r\ndebug3: timeout: 10000 ms remain after connect\r\ndebug1: identity file /home/erami/.ssh/id_rsa type 0\r\ndebug1: identity file /home/erami/.ssh/id_rsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_dsa type -1\r\ndebug1: identity file /home/erami/.ssh/id_dsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_ecdsa type -1\r\ndebug1: identity file /home/erami/.ssh/id_ecdsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_ed25519 type -1\r\ndebug1: identity file /home/erami/.ssh/id_ed25519-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_xmss type -1\r\ndebug1: identity file /home/erami/.ssh/id_xmss-cert type -1\r\ndebug1: Local version string SSH-2.0-OpenSSH_7.9p1 Ubuntu-10\r\nIdentity added: /home/local/company/user/.ssh/id_rsa (/home/local/company/user/.ssh/id_rsa)\nnc: getaddrinfo: Name or service not known\nssh_exchange_identification: Connection closed by remote host\r\n') fatal: [activemq73.test.lx.company.at]: UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh: OpenSSH_7.9p1 Ubuntu-10, OpenSSL 1.1.1b 26 Feb 2019\r\ndebug1: Reading configuration data /home/erami/.ssh/config\r\ndebug1: /home/erami/.ssh/config line 4: Applying options for *.*.lx.company.at\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: Control socket \"/home/erami/.ansible/cp/62f9ffd3e1\" does not exist\r\ndebug1: Executing proxy command: exec ssh -o 'ForwardAgent yes' norfair 'ssh-add ~/.ssh/id_rsa && nc activemq73.test.lx.company.at 22'\r\ndebug3: timeout: 10000 ms remain after connect\r\ndebug1: identity file /home/erami/.ssh/id_rsa type 0\r\ndebug1: identity file /home/erami/.ssh/id_rsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_dsa type -1\r\ndebug1: identity file /home/erami/.ssh/id_dsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_ecdsa type -1\r\ndebug1: identity file /home/erami/.ssh/id_ecdsa-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_ed25519 type -1\r\ndebug1: identity file /home/erami/.ssh/id_ed25519-cert type -1\r\ndebug1: identity file /home/erami/.ssh/id_xmss type -1\r\ndebug1: identity file /home/erami/.ssh/id_xmss-cert type -1\r\ndebug1: Local version string SSH-2.0-OpenSSH_7.9p1 Ubuntu-10\r\nIdentity added: /home/local/company/user/.ssh/id_rsa (/home/local/company/user/.ssh/id_rsa)\nnc: getaddrinfo: Name or service not known\nssh_exchange_identification: Connection closed by remote host", "unreachable": true }
is there someway to disable this behaviour?
im trying to provision hosts like:
but it throws error, because ansible can't reach those hosts (logically, they aren't created yet'), how should that work?:
is there someway to disable this behaviour?