Forge Home

systemd

SYSTEMD configuration

62,363 downloads

922 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 1.2.0 (latest)
  • 1.1.0
  • 1.0.2
  • 1.0.1 (deleted)
  • 1.0.0
released Jul 22nd 2021
This version is compatible with:
  • Puppet Enterprise 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >=4.0.0
  • ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'pk-systemd', '1.2.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add pk-systemd
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install pk-systemd --version 1.2.0

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download
Tags: systemd

Documentation

pk/systemd — version 1.2.0 Jul 22nd 2021

systemd

Overview

This module manages systemd configuration files.

Module Description

Manages systemd unit files in /etc/systemd/system. The base ::systemd class provides some pertinent system-wide variables. The following defined types manage systemd unit file instances.

systemd::unit

manages the content of systemd unit configuration files. Used by
type specific manifests in the systemd::unit:: namespace.

systemd::unitfrag

manages the content auxiliary systemd unit configuration files that
supplements a unit's main configuration. This is useful to manage selected
unit settings if the main configuration file is maintained by other means,
e.g. in an application package.

Example:

  systemd::unitfrag { 'apache:;service::umask':
    ensure       => 'present',
    unit_name    => $::apache::service_name,
    unit_type    => 'service',
    frag_name    => 'umask',
    type_options => { 'UMask' => $service_umask },
    notify       => Service[$::apache::service_name],
  }

 This manages an auxiliary systemd configuration file in '/etc/systemd/system/apache.service.d/'
 that causes the UMask options to merged into the apache service systemd settings.

systemd::service::simple

manages a simple service unit. Parameters correspond to a subset of
unit file directives

Example:

  systemd::service::simple { $service_name:
    description            => 'Tomcat App',
    cond_path_is_directory => $catalina_home,
    service_user           => $user,
    service_group          => $group,
    service_type           => 'forking',
    exec_start             => "${catalina_home}/bin/startup.sh",
    exec_stop              => "${catalina_home}/bin/shutdown.sh",
  }

Defines a systemd unit that runs a tomcat-based application as a service.

systemd::service::custom

manages an arbitrary systemd unit file based on a custom configuration
file source.

The following resources in the systemd::unit namespace have parameters that represent typical unit-specific configuration options. All of them accept parameters ('*_options') that allow any systemd options to be configured. These parameters accept an array of values, which result in systemd directives with values separated by spaces. The first element in an array of values passed to the puppet resources is treated specially: if this element is the empty string or the reserved word 'RESET', then a systemd configuration line of the form "Directive=" is generated, which effectively resets this directive in the systemd unit.

Note that in all system::unit resources, the 'description' parameter is mandatory.

systemd::unit::mount

manages a systemd mount unit.

systemd::unit::automount

manages a systemd automount unit and also the accompanying mandatory
mount unit.

Example:

  systemd::unit::automount { 'rhome':
    ensure       => present,
    description  => 'Remote home directories volumes',
    where        => '/home',
    what         => 'stores.example.org:/home',
    type         => 'nfs',
    options      => 'nolock,noatime,bg',
    idle_timeout => 900
  }

Defines both a systemd automount and its associated mount unit to manage a
NFS-based remote volume with automatic unmount after 15 minutes of inactivity.

systemd::unit::service

manages a systemd service unit.

systemd::unit::socket

manages a systemd socket unit.

systemd::unit::timer

manages a systemd timer unit.

systemd::unit::path

manages a systemd path unit.