voxpupuli / puppet-corosync

Sets up and manages Corosync.
https://forge.puppet.com/puppet/corosync
Apache License 2.0
44 stars 162 forks source link

Dependency problem when enabling secauth and disabling service management #452

Closed timdeluxe closed 3 years ago

timdeluxe commented 5 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

class { 'corosync':
    authkey                  => '/etc/foobar_corosync_authkey',
    bind_address             => $bind_address,
    unicast_addresses        => $unicast_addresses,
    cluster_name             => $cluster_name,
    enable_secauth           => true,
    set_votequorum           => true,
    quorum_members           => $quorum_members,
    token                    => 60000,
    enable_corosync_service  => false,
    enable_pacemaker_service => false,
    manage_corosync_service  => false,
    manage_pacemaker_service => false,
}

What are you seeing

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Could not find resource 'Service[corosync]' in parameter 'notify' (file: /etc/puppetlabs/code/environments/production/modules/corosync/manifests/init.pp, line: 423) on node XXXXXXX

What behaviour did you expect instead

A clean run (no error)

Output log

see above

Any additional information you'd like to impart

The error origins in dependencies. Problem is that the service as well as secauth (where the notify comes from) are optional, so it wouldn't help to subscribe from the service instead of notifying from the file. I think the only solution is a "if" statement and having the file resources twice, one with the notify, the other without.

timdeluxe commented 5 years ago

This section in init.pp is also problematic in that sense:

        augeas { 'enable corosync':
          lens    => 'Shellvars.lns',
          incl    => '/etc/default/corosync',
          context => '/files/etc/default/corosync',
          changes => [
            'set START "yes"',
          ],
          require => $corosync_package_require,
          before  => Service['corosync'],
        }