Version information
Start using this module
Add this module to your Puppetfile:
mod 'oppegaard-openbsd', '0.1.1'
Learn more about managing modules with a PuppetfileDocumentation
Module for managing OpenBSD
The OpenBSD module contains a plugin for managing the entries in /etc/rc.conf.local and an updated service provider. The two combined makes it possible to enable services and notify them. Classes for other OpenBSD-related functionality which is too OpenBSD specific or too small to warrant their own modules are also included.
The module is tested on OpenBSD 5.2 and with Puppet 2.7.14.
Installation
The plugins require pluginsync = true in puppet.conf.
The classes use a custom mount point, /module_data
, for looking up private data
such as login.conf and mtree files, which should not be part of the module release.
Each class which uses this mount point has a parameter _mount
, however, if you
want to change it to /modules/openbsd
and use the /modules
mount point.
Setup the /module_data
mount point in fileserver.conf
:
[module_data] path /var/puppet/module_data allow *.my.domain
The directory should be owned by root:wheel and have permissions 0755. This is to have the same general permissions as the files would have in /etc. Some files need more relaxed permissions than their /etc counterparts, however; _puppet needs read access.
Data files have to be provided by the user, possibly from the host system.
Plugins
There are two plugings included: an improved service provider and rcconf
.
Service provider
The service provider is a small extension to the init.d
provider which adds
support for rc.d(8)
init scripts so services can have their status checked
and subscribe to or get notified by other resourcesf.
rcconf
The rcconf
type manages entries in /etc/rc.conf.local
. It's based on
parsedfile
and is ensurable
. Double quotes has to managed by the user!
Examples
rcconf { 'httpd_flags': value => '"-DSSL"', }
rcconf { 'ntpd_flags':; }
The default value is a double quoted empty string ""
. This may be changed in
the future.
Classes
There are three classes included in release 0.1.0
: login_conf
, mtree
and
pkg_conf
.
login_conf
Manages login.conf(5)
. This is a file based class; puppet only copies ready-made
login.conf
files to the node.
The default mount point is /module_data
, which should be installed and populated
with default configuration files from your system. Host specific files on the form
login.conf-${::fqdn}
take precedence.
Examples
include openbsd::login_conf
mtree
Manages the files in /etc/mtree
and runs mtree(8)
. mtree
is a file based class.
The default mount point is /module_data
, which should be installed.
The specs which are applied are
- 4.4BSD.dir
- BSD.local.dist
- BSD.x11.dist
- special
Host specific files on the form <file>-${::fqdn}
take precedence.
Examples
include openbsd::mtree
pkg_conf
Manages pkg.conf(5)
. pkg_conf
takes a $settings
hash with all the settings
that should be written to the file, which is overwritten completely by puppet.
If a key's value is an array, the entries after the first will be on the form
key += val. The first setting is always key = val.
Examples
class { 'openbsd::pkg_conf': settings => { installpath => [ "file:///mnt/openbsd/${::operatingsystemrelease}/packages/${::architecture}/", "ftp://ftp.eu.openbsd.org/pub/OpenBSD/${::operatingsystemrelease}/packages/${::architecture}/", ], ntogo => 'yes', }, }
Types in this module release
Changes from 0.1.0 to 0.1.1:
Added README file and openbsd::mtree
now logs to info instead of notice, so that
the logs won't fill up with exec notices.
Dependencies
- puppetlabs/stdlib (>= 3.2.0)
Copyright (c) 2012 Martin Oppegaard <martin.oppegaard at gmail dot com> Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.