garethr / garethr-docker

Puppet module for managing docker
Apache License 2.0
398 stars 534 forks source link

After upgrading garethr-docker version to 5.2.0 puppet run fails due to dependency cycle #519

Open svenmueller opened 8 years ago

svenmueller commented 8 years ago
Error: Failed to apply catalog: Found 1 dependency cycle:
(Exec[/bin/sh /etc/init.d/docker-backend stop] => Docker::Run[backend] => Class[Backend] => Class[Frontend] => Docker::Image[xxx/yyy] => Exec[echo 'Update of xxx/yyy:latest complete'] => Docker::Image[xxx/yyy] => Docker::Run[backend] => Exec[/bin/sh /etc/init.d/backend stop])
Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz

We are currently stucked here. Any idea?

$ sudo lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.04.4 LTS
Release:    14.04
Codename:   trusty
$ sudo uname -r
3.13.0-85-generic
$ puppet --version
3.8.7
mbelang commented 8 years ago

I reproduced the problem. This happen when you have multiple docker:run command in your puppet manifests.

svenmueller commented 8 years ago

Hi, yes that is also the case for me.

garethr commented 7 years ago

@svenmueller @mbelang could you post a snipped of Puppet code that causes this issue? I'll investigate further.

mbelang commented 7 years ago

This in one puppet manifest: docker::run { 'mysql': image => 'mysql', hostname => "${::fqdn}", volumes => '/data/mysql:/var/lib/mysql', env => [ "MYSQL_ROOT_PASSWORD=${root_password}", "MYSQL_DATABASE=${database_name}", "MYSQL_USER=${database_user}", "MYSQL_PASSWORD=${database_password}", ], }

And this in an other manifest in the same tree: docker::run { 'nexus': image => 'mat128/docker-nexus', ports => ['8081:8081'], hostname => "${::fqdn}", volumes => '/data/sonatype-work:/opt/sonatype-work', username => 'root', env => ['RUN_AS_USER=root'], } }