I have thousands of servers that, by default, for security and space do not create a $HOME
when you ssh
in.
This seems to be posing a problem for Ansible as it keeps trying to chdir to home
that does not exist. Can I get Ansible to use another directory in the ansible.cfg
or just stop this behaviour completely?
ansible.cfg
[defaults]
inventory = /home/welshch/.ansible/hosts
remote_tmp = /tmp
local_tmp = ~/.ansible/tmp
interpreter_python = auto_silent
roles_path = /home/eekfonky/.ansible/roles
host_key_checking = False
Here is the error with the server name changed for security reasons;
☁ .ansible ansible-playbook get_fleet_info.yml -vvvv
fatal: [ldap-corp-search-server.com]: FAILED! => {
"ansible_facts": {
"discovered_interpreter_python": "/usr/bin/python"
},
"changed": false,
"module_stderr": "OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017\r\ndebug1: Reading configuration data /home/eekfonky/.ssh/config\r\ndebug1: /home/eekfonky/.ssh/config line 2: Applying options for *\r\ndebug3: /home/eekfonky/.ssh/config line 9: Including file /home/eekfonky/.ssh/bastions-config depth 0\r\ndebug1: Reading configuration data /home/eekfonky/.ssh/bastions-config\r\ndebug1: /home/eekfonky/.ssh/bastions-config line 10: Applying options for *.corp.amazon.com\r\ndebug1: /home/ekfonky/.ssh/bastions-config line 35: Applying options for *.pdx*.server.com\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 58: Applying options for *\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 = 27395\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 1\r\nShared connection to ldap-corp-search-server.com closed.\r\n",
"module_stdout": "Could not chdir to home directory /home/eekfonky: No such file or directory\r\n",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1
}