Closed joaocc closed 9 years ago
It seems like building the destination path does not work, when using overlayfs.
What is the content of lxc.rootfs
on your system?
in the config file for the container, I have
lxc.rootfs = overlayfs:/var/lib/lxc/LXC-Template-1404/rootfs:/var/lib/lxc/lxc-demo/delta0
In my setup, I currently don't use overlayfs, but does it helps, if you replace the _root_fs() method in lxc.py
def _root_fs(self):
rootfs = self.container.get_running_config_item("lxc.rootfs")
if not rootfs:
raise errors.AnsibleError("rootfs not set in configuration for %s") % self.host
return rootfs
with:
def _root_fs(self):
import re
rootfs = self.container.get_running_config_item("lxc.rootfs")
# overlayfs use the scheme:
# overlayfs:/var/lib/lxc/LXC-Template-1404/rootfs:/var/lib/lxc/lxc-demo/delta0
match = re.match(r'^overlayfs:.+?rootfs:(.+)', rootfs)
if match:
rootfs = match.group(1)
if not rootfs:
raise errors.AnsibleError("rootfs not set in configuration for %s") % self.host
return rootfs
That did the trick! I sent a pull request in case you want to add this to your repo. Thanks a lot.
Hi, I am trying to get this to run on Ubuntu 14.04 with LXC 1.0.6 and Ansible v1.8.2. When I try to connect to a freshly installed guest (template ubuntu-cloud / trusty), I get the following error:
After this, I confirm that the /var/lib/lxc/lxc-demo/delta0/home/vagrant/.ansible/tmp/ansible-tmp-1420214512.67-65457909308433 folder exists, but is empty.
Any ideas on what might be going wrong? Thanks