openbsd

Plugins and classes for OpenBSD

Martin Oppegaard

oppegaard

9,737 downloads

9,507 latest version

1.5 quality score

Version information

  • 0.1.1 (latest)
  • 0.1.0
released Dec 21st 2012

Start using this module

Documentation

oppegaard/openbsd — version 0.1.1 Dec 21st 2012

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', }, }