Open linuxcube opened 6 years ago
This is what my init.pp looks like:
#
#
#
#
#
# class rsyslog ( $package_ensure = 'present', $config_dst = '/etc/rsyslog.conf', $config_src = undef, $config_ensure = present, $log_perm = '0644', $manage_syslog = true, $logrotate_exclude_list = false, $logrotate_list = [ 'cron', 'maillog', 'messages', 'secure', 'spooler' ] ) {
include rsyslog package { 'rsyslog' : ensure => $package_ensure, } if ( $config_src == undef and $::operatingsystemmajrelease == '5' ) { $real_config_src = 'puppet:///modules/rsyslog/rsyslog.conf5' } elsif ( $config_src == undef ) { $real_config_src = 'puppet:///modules/rsyslog/rsyslog.conf' } else { $real_config_src = $config_src }
class { '::rsyslog::service': manage_syslog => $manage_syslog } class { '::rsyslog::config': config_dst => $config_dst, config_src => $real_config_src, config_ensure => $config_ensure, log_perm => $log_perm, logrotate_exclude_list => $logrotate_exclude_list, logrotate_list => $logrotate_list } Package['rsyslog'] -> Class['::rsyslog::config'] -> Class['::rsyslog::service'] }
When I did my puppet run to validate the module, I keep getting that the declaration is duplicated somewhere:
puppet agent -tv Info: Using configured environment 'development' Info: Retrieving pluginfacts Info: Retrieving plugin Info: Retrieving locales Info: Loading facts Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Class[Rsyslog::Service] is already declared; cannot redeclare (file: /etc/puppetlabs/code/environments/development/modules/rsyslog/manifests/init.pp, line: 44) (file: /etc/puppetlabs/code/environments/development/modules/rsyslog/manifests/init.pp, line: 44, column: 3) on node pocn07.na.domain.com Warning: Not using cache on failed catalog Error: Could not retrieve catalog; skipping run
Can someone provide some pointer on this issue?