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?
Thansk for you answer barto, but I still get same error. I don’t know, if this error means, that Ansible hasn’t permission to write to /tmp/ in mgmt-dvm or in target template; in my case fedora-clone-ansible (?)
---
- hosts: local
connection: local
tasks:
- name: clone template
qubesos:
name: fedora-clone-ansible
state: present
template: "fedora-demo"
vmtype: TemplateVM
what should I change for hosts and connection values? And how to change invenroty file?
I have made changes to files in /etc/qubes/policy.d/include/ and created /etc/qubes/policy.d/30-mgmtvm.policy file as instructed in Github.
I have had this problem. After much searching I found:
the target was a template - I do not know if this is important.
the target qube was not running. Lets call it “tpl-target”
the hidden management qube was running. For example: qvm-ls | grep disp-mgmt- shows “disp-mgmt-tpl-target”
after qvm-kill of the “disp-mgmt-tpl-target” qube, my playbook could run.
[see Edit2, below, and ignore this :I think that this must have happened after I did Ctrl-C during an ansible-playbook run.
I think there must be some cleanup which my Ctrl-C bypassed. Maybe there is some missing trap or test in qubes-ansible but I really do not know what it should be.]
[Edit2: I find that “Shut down when idle” is inactive on default-dvm and default-mgmt-dvm, because of missing qubes-app-shutdown-idle package in the template. Maybe this could explain the problem I see…] [Edit 3: No, at least some disposables are shutting down correctly… I have no explanation]
[Edit: I took the liberty of making the title more descriptive. I hope it is OK]