Hi,
I’ve run same installation task with ansible successfully on a few Debian 11 and 12 servers, first step is to check if all is setup with ansible all -m ping
. Everything works fine except with one Debian 12 server
ansible server (Debian 11) :
ansible all -m ping -vvv
ansible [core 2.12.5]
config file = /etc/ansible/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.9/dist-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.9.2 (default, Dec 1 2024, 12:12:57) [GCC 10.2.1 20210110]
jinja version = 2.11.3
libyaml = True
Using /etc/ansible/ansible.cfg as config file
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
script declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
auto declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details
Parsed /etc/ansible/hosts inventory source with ini plugin
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
META: ran handlers
<remote ip> ESTABLISH SSH CONNECTION FOR USER: xxxxx
<remote ip> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="xxxxx"' -o ConnectTimeout=10 -o 'ControlPath="/root/.ansible/cp/3f945fea3f"' remote ip '/bin/sh -c '"'"'echo ~xxxxx && sleep 0'"'"''
<remote ip> (127, b'/home/xxxxx\n', b'/bin/sh: 1: sleep: not found\n')
<remote ip> Failed to connect to the host via ssh: /bin/sh: 1: sleep: not found
<remote ip> ESTABLISH SSH CONNECTION FOR USER: xxxxx
<remote ip> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o 'User="xxxxx"' -o ConnectTimeout=10 -o 'ControlPath="/root/.ansible/cp/3f945fea3f"' remote ip '/bin/sh -c '"'"'( umask 77 && mkdir -p "` echo /home/xxxxx/.ansible/tmp `"&& mkdir "` echo /home/xxxxx/.ansible/tmp/ansible-tmp-1736781642.3676438-935005-233802510071625 `" && echo ansible-tmp-1736781642.3676438-935005-233802510071625="` echo /home/xxxxx/.ansible/tmp/ansible-tmp-1736781642.3676438-935005-233802510071625 `" ) && sleep 0'"'"''
<remote ip> (127, b'', b'/bin/sh: 1: mkdir: not found\n')
<remote ip> Failed to connect to the host via ssh: /bin/sh: 1: mkdir: not found
remote ip | UNREACHABLE! => {
"changed": false,
"msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo /home/xxxxx/.ansible/tmp `\"&& mkdir \"` echo /home/xxxxx/.ansible/tmp/ansible-tmp-1736781642.3676438-935005-233802510071625 `\" && echo ansible-tmp-1736781642.3676438-935005-233802510071625=\"` echo /home/xxxxx/.ansible/tmp/ansible-tmp-1736781642.3676438-935005-233802510071625 `\" ), exited with result 127",
"unreachable": true
}
target server Debian 12 (bookworm)
python3 -m pip -V
pip 23.0.1 from /usr/lib/python3/dist-packages/pip (python 3.11)
if I connect to the remote server with ssh and user xxxxxx, I have access, I have a bash and can run sleep, mkdir or whatever command.
I’ve tried to add in ansible.cfg
[defaults]
executable = /bin/bash
Not better ! Any idea ?
Thank you
Best wishes for 2025 !