Hello,
I installed Ansible as described in README.md https://github.com/QubesOS/qubes-ansible/blob/main/README.md:
- to Dom0 I installed qubes-ansible-dom0
- to template used for default-mgmt-dvm (fedora-43-xfce) I installed qubes-ansible-vm
Then I appended lines as described in Management VM-section to files:
- /etc/qubes/policy.d/include/admin-local-rwx
- /etc/qubes/policy.d/include/admin-global-ro
- /etc/qubes/policy.d/30-ansible.policy
Next I created inventory file:
[local]
localhost
[local:vars]
ansible_connection=local
[appvms]
fedora-demo-appvm
[appvms:vars]
ansible_connection=qubes
[templatevms]
fedora-demo # this is existing template
fedora-clone-ansible
[templatevms:vars]
ansible_connection=qubes
Then I created a playbook that should:
- clone fedora-demo template as new template with name fedora-clone-ansible
- start it
- install flatpak package to it (by using mgmt-dvm as proxy)
This is my playbook.yaml:
---
- hosts: local
connection: local
tasks:
- name: clone template
qubesos:
name: fedora-clone-ansible
state: present
template: "fedora-demo"
vmtype: TemplateVM
- hosts: local
tasks:
- name: start template
qubesos:
name: fedora-clone-ansible
state: running
wait: true
- hosts: fedora-clone-ansible
tasks:
- name: install flatpak
become: yes
dnf:
package: flatpak
Everything works fine until last task. Qubes starts mgmt-dvm-fedora-clone-ansible, but then I get an error:
fatal: [fedora-clone-ansible]: 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-1778910509.4363546-763-113605423299708" && echo ansible-tmp-1778910509.4363546-763-113605423299708="echo ~/.ansible/tmp/ansible-tmp-1778910509.4363546-763-113605423299708" ), exited with result 1”,
“unreachable”: true
}
How to get this working?