debops / ansible-lxc

Configure and manage LXC environment on a host
GNU General Public License v3.0
17 stars 10 forks source link

Rework 2 #29

Closed ypid closed 7 years ago

drybjed commented 7 years ago

I've looked into this PR some more, looks like AppArmor on Travis-CI is preventing the correct installation, the error seems to be:

AppArmor parser error for /etc/apparmor.d/lxc-containers in /etc/apparmor.d/lxc-containers at line 5: Could not open 'tunables/global'\ndpkg: error processing lxc (--configure):\n subprocess installed post-installation script returned error exit status 1

I tried to disable the AppArmor role in the playbook, but I guess it's already installed. Maybe there's a way to disable AppArmor in the Travis-CI build?

ypid commented 7 years ago

I have not experianced such problems before. keyhole.pubsrv.ypid.de (Debian jessie) has AppArmor enabled and hosts LXC containers. Maybe for Ubuntu there is configuration needed? You could try to disable AppArmor:

service apparmor teardown
service apparmor stop
aa-status
# Should show 0 loaded profiles.

But I am not sure if that would fix the problem.

ypid commented 7 years ago

Also, maybe try to run the debops-contrib.apparmor before or something like touch /etc/apparmor.d/tunables/global.

drybjed commented 7 years ago

@ypid The AppArmor role was running in the Travis-CI test, I disabled it with no effect. Let me try tearing down AppArmor first to see what happens.

drybjed commented 7 years ago

Trying to fix AppArmor didn't work, but! It seems that .travis.yml does not have sudo: True, so it uses the Docker container infrastructure for the builds. @ypid, can you add sudo: True to the Travis config, maybe that will work?

ypid commented 7 years ago

Sure. Thanks for looking into this!

drybjed commented 7 years ago

@ypid Looks like disabling AppArmor on Trusty lets the rest of the role pass, it seems that the debops-contrib.apparmor does not ensure that a required directory exists. Do you want to fix that (test it on Trusty) before merging debops.lxc changes?

ypid commented 7 years ago

@drybjed Sure, I can do that later today. Tests for debops-contrib.apparmor pass on precise (https://travis-ci.org/debops-contrib/ansible-apparmor)

But the debops.lxc role also failed before on precise. I switched the test to Trusty to see if that changes something.

ypid commented 7 years ago

Good catch, thanks. All fixed.