Hi everybody,
Today I tried to use community.general.incus connection plugin in Ansible to connect to my Incus hosts.
I can see with incus monitor
that the incus client is able to connect to the remote incus server :
location: none
metadata:
context:
fingerprint: 3f78c723a53d3aa1c1fc4c3cd72cf502d6afa9febba8f4cd6579e244f3fb423e
subject: CN=ansible@********,O=Linux Containers
level: debug
message: Matched trusted cert
timestamp: "2024-06-12T17:36:20.212473435+02:00"
type: logging
, however, I receive an error from Ansible :
<backup> ESTABLISH Incus CONNECTION FOR USER: root
<backup> EXEC /bin/sh -c 'echo ~root && sleep 0'
<backup> EXEC /bin/sh -c 'echo "`pwd`" && sleep 0'
<backup> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo ~/.ansible/tmp `"&& mkdir "` echo ~/.ansible/tmp/ansible-tmp-1718206580.2711267-79392-159239038532662 `" && echo ansible-tmp-1718206580.2711267-79392-159239038532662="` echo ~/.ansible/tmp/ansible-tmp-1718206580.2711267-79392-159239038532662 `" ) && sleep 0'
fatal: [**************]: 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 ~/.ansible/tmp `\"&& mkdir \"` echo ~/.ansible/tmp/ansible-tmp-1718206580.2711267-79392-159239038532662 `\" && echo ansible-tmp-1718206580.2711267-79392-159239038532662=\"` echo ~/.ansible/tmp/ansible-tmp-1718206580.2711267-79392-159239038532662 `\" ), exited with result 1",
"unreachable": true
}
I can connect to my Incus hosts with ssh connection.
The inventory :
"backup.bricstar.eu": {
"ansible_incus_host": "*********",
"ansible_incus_remote": "*********",
"ansible_ssh_port": "xxxx",
"ansible_ssh_private_key_file": "~/.ssh/id_rsa_omrs-ansible",
"ansible_user": "ansible-user",
"hostname": "*********",
"ipv4": "*********",
}
Maybe it is more an Ansible problem than an Incus problem ?