Hello all,

I'm new to this great tool.
In our enviroment, we use different linux/unix flavors (CentOS/Ubuntu/
OpenBSD).
Everything works fine, but in OpenBSD we have some issues.
Some packages that are installed by the default installation on
OpenBSD, like snmpd and ntpd, also need to be installed in CentOS and
Ubuntu.
So, we created a module that handle these services.

Like this one:

class snmp {

    include snmp::params

    package { "$snmp::params::snmp_package":
        ensure => present,
    }

    file { "snmp.conf":
        owner    => root,
        group    => root,
        mode     => '0644',
        path     => "$snmp::params::snmp_config_path",
        content  => template("snmp/etc/snmp/snmpd.conf.erb"),
        require  => Package["snmpd"],
    }

    service { "snmpd":
        ensure     => running,
        start      => $operatingsystem ? {
                'OpenBSD'  => "/usr/sbin/snmpd",
                 default   => undef,
        },
        stop      => $operatingsystem ? {
                'OpenBSD'  => "pkill snmpd",
                 default   => undef,
        },
        enable     => true,
    }
}

class snmp::params {

    case $operatingsystem {
        OpenBSD: {
            $snmp_package       = "snmpd"
            $snmp_config_path   = "/etc/snmpd.conf"
        }
        /(Ubuntu|Debian)/: {
            $snmp_package       = "snmpd"
            $snmp_config_path   = "/etc/snmp/snmpd.conf"
        }
        CentOS: {
            $snmp_package       = "net-snmp"
            $snmp_config_path   = "/etc/snmp/snmpd.conf"
        }
    }
}

When we wanna assure that package is present in our OpenBSD box, the
puppet agent try to execute "pkg_info -I snmpd".
If we set PKG_PATH to our internal mirror this command freezes, if we
unset our PKG_PATH we recieve this message:

info: Applying configuration version '1308232496'
debug: Service[snmpd](provider=bsd): Executing 'ps auxwww'
debug: Service[snmpd](provider=bsd): PID is 993
debug: Puppet::Type::Package::ProviderOpenbsd: Executing '/usr/sbin/
pkg_info snmpd'
err: /Stage[main]/Snmp/Package[snmpd]/ensure: change from absent to
present failed: You must specify a package source for BSD packages

Is a better way to handle this issue? Has anyone use OpenBSD box?

Best Regards,

Sidarta Oliveira

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to