systemd

Systemd support helper

justin8

justin8

42,083 downloads

38,808 latest version

3.1 quality score

Version information

  • 0.4.0 (latest)
  • 0.3.0
  • 0.2.0
  • 0.1.0
released May 25th 2016
This version is compatible with:
  • Puppet >=3.4.0 < 4.0.0
  • Archlinux,
    Fedora
    ,
    RedHat
    ,
    Scientific
    ,
    CentOS
    ,
    Debian
    ,
    Ubuntu

Start using this module

Documentation

justin8/systemd — version 0.4.0 May 25th 2016

Puppet Forge Build Status

Justin8-Systemd

Table of Contents

  1. Overview
  2. Module Description
  3. Setup - The basics of getting started with systemd
  4. Usage - Configuration options and additional functionality
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Overview

This module provides some basic functionality around systemd within puppet to better allow modules to support both systemd and legacy init systems within the same module.

Module Description

This module provides a fact to identify systemd-enabled systems and an exec that can be called to reload systemd daemon configurations.

Setup

What systemd affects

  • Nothing

Beginning with systemd

The module will do nothing by itself. It is only to be used as support for other modules.

Check the usage section for details.

The very basic steps needed for a user to get the module up and running.

If your most recent release breaks compatibility or requires particular steps for upgrading, you may wish to include an additional section here: Upgrading (For an example, see http://forge.puppetlabs.com/puppetlabs/firewall).

Usage

The most basic usage is as follows (within another module):

include systemd

This will give you access to $::systemd::params::unit_path which is usually /usr/lib/systemd/system or /lib/systemd/system depending on distro.

It will also give you access to the systemd_available fact, which evaluates to 'true' if systemd is available.

There is an exec called 'systemd-daemon-reload' that can be called to refresh configurations when they are changed so it isn't required seperately in each module.

Hopefully this will be unecessary in future puppet releases, but currently there is no way to tell the init system, and no way to auto-reload systemd daemons when they change.

An example usage is below:

if $::systemd_available == 'true' {
    file {"${::systemd::params::unit_path}/foo.service":
        content => template('foo/foo.service.erb'),
        before  => Service['foo'],
        notify  => Exec['systemd-daemon-reload'],
    }

    systemd::service { 'bar':
        description  => 'Bar service',
        execstart    => '/bin/bar',
        wants        => ['network.target', 'foo.service'],
    }
}

service { 'foo':
    ensure => running,
    after  => Exec['systemd-daemon-reload'],
}

service { 'bar':
    ensure => running,
}

Limitations

Works with all Linux distributions! (Untested on most ;)) On non-systemd distributions it will provide the systemd_available fact as 'false', but nothing else (as intended).

Development

Pull requests welcome via github.