Puppet Class: sys::openbsd::pkg

Inherits:
sys::openbsd::params
Defined in:
manifests/openbsd/pkg.pp

Overview

Class: sys::openbsd::pkg

Sets up the OpenBSD package configuration file (/etc/pkg.conf).

Note: A node must be initialized with the ‘puppet::openbsd` class, by itself, before anything in here will actually work. See:

http://projects.puppetlabs.com/issues/8435

Parameters:

  • config (Any) (defaults to: '/etc/pkg.conf')
  • source (Any) (defaults to: $sys::openbsd::params::mirror)


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'manifests/openbsd/pkg.pp', line 9

class sys::openbsd::pkg (
  $config = '/etc/pkg.conf',
  $source = $sys::openbsd::params::mirror,
) inherits sys::openbsd::params {

  # `/etc/pkg.conf` sets settings system-wide for the `pkg_*`
  # utilities on OpenBSD; it eliminates the need for setting
  # PKG_PATH environment variable.
  file { $config:
    ensure  => file,
    owner   => 'root',
    group   => 'wheel',
    mode    => '0644',
    content => "# OpenBSD pkg.conf\ninstallpath=${source}\n",
  }

  # Ensure the file is in place for OpenBSD's package provider.
  File[$config] -> Package <| |>
}