Help with dependancy cycle

58 views
Skip to first unread message

Adam Clark

unread,
Mar 27, 2014, 10:31:40 PM3/27/14
to puppet...@googlegroups.com
Hi all,
  I am writing a module to manage MySQL/MariaDB with Galera extensions and have run into a problem I don't seem to be able to figure out.

Error: Could not apply complete catalog: Found 1 dependency cycle:
(File[/etc/mysql/conf.d/wsrep.cnf] => Service[mysqld] => Class[Mysql::Server] => Class[Mysql::Config] => File[/etc/mysql/conf.d] => File[/etc/mysql/conf.d/wsrep.cnf])
Cycle graph written to /var/lib/puppet/state/graphs/cycles.dot.

A cut down version of my puppet file is:
class galera::server (
 #<snip>
) inherits mysql {

  #<snip>

  class { 'mysql::server':
    config_hash  => $config_hash,
    package_name => $server_package_name,
    service_name => $service_name,
  }

  #<snip>

  file { '/etc/mysql/conf.d/wsrep.cnf' :
    ensure  => present,
    mode    => '0644',
    owner   => 'root',
    group   => $root_group,
    content => template('galera/wsrep.cnf.erb'),
    #require => File['/etc/mysql/conf.d/'],
    notify  => Service['mysqld']
  }
}

I am using the current puppetlabs-mysql (v0.9.0) from puppet forge.

I need the file to go in after the /etc/mysql/conf.d/ resource is complete, but before the service is started. 

The /etc/mysql/conf.d/ resource is listed in mysql::config as:
class mysql::config(
  # <snip>
  $purge_conf_dir                   = $mysql::purge_conf_dir,
) inherits mysql {
  

  file { '/etc/mysql/conf.d':
    ensure  => directory,
    mode    => '0755',
    recurse => $purge_conf_dir,
    purge   => $purge_conf_dir,
  }
}

class mysql(
  #<snip>
  $purge_conf_dir        = $mysql::params::purge_conf_dir,
  #<snip>
) {
  #<snip>
}

class mysql::params {
 # <snip>
  $purge_conf_dir      = false 
 #<snip>
}

Does it have something to do with the recurse/purge metaparameters?  The defaults seem to be set as false.

Full puppet file attached and dot file from --graph.

Any light into this would be great.

Adam

cycles.dot
server.pp

Xav Paice

unread,
Mar 27, 2014, 11:10:46 PM3/27/14
to puppet...@googlegroups.com
On 28/03/14 15:31, Adam Clark wrote:
Hi all,
  I am writing a module to manage MySQL/MariaDB with Galera extensions and have run into a problem I don't seem to be able to figure out.

Error: Could not apply complete catalog: Found 1 dependency cycle:
(File[/etc/mysql/conf.d/wsrep.cnf] => Service[mysqld] => Class[Mysql::Server] => Class[Mysql::Config] => File[/etc/mysql/conf.d] => File[/etc/mysql/conf.d/wsrep.cnf])
Cycle graph written to /var/lib/puppet/state/graphs/cycles.dot.


Hi,

I usually find a cup of coffee and a walk round the block sorts that kind of issue out - but it also usually involves a bit of drastic re-thinking and a large whiteboard picture ;(.

You might find https://github.com/xavpaice/puppet-mariadb helpful - it's a bit of work I nabbed from NeCTAR and added bits to, but it's quite out of date now.

Adam Clark

unread,
Mar 27, 2014, 11:34:58 PM3/27/14
to puppet...@googlegroups.com
I am trying to use this with the modules from forgestack, which only have mysql providers.

Might be easier to just use the puppet-mariadb module and write a new provider into all the various openstack modules.

Regardless, would be great to get an answer for when this stuff happens in the future.

Cheers

Adam



--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/PBYkTZQ3oUY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/5334E836.3060309%40gmail.com.

For more options, visit https://groups.google.com/d/optout.

jcbollinger

unread,
Mar 28, 2014, 11:31:01 AM3/28/14
to puppet...@googlegroups.com
The mysql module you are trying to use appears to be broken, even before considering relationships with external resources.  Notice how it orders Service['mysqld'] before File['/etc/mysql/conf.d'] -- that's not your doing, but it's probably wrong, and it's definitely causing your problem.


John

Adam Clark

unread,
Mar 28, 2014, 8:09:03 PM3/28/14
to puppet...@googlegroups.com

Cheers.  I might try extending the PE supported module.  This one was dragged in from the openstack module as a dependency I think.

Adam

--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/PBYkTZQ3oUY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages