Forge Home

systemd

Systemd support helper

43,641 downloads

40,113 latest version

3.1 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.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

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

Start using this module

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

Add this module to your Puppetfile:

mod 'justin8-systemd', '0.4.0'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install justin8-systemd --version 0.4.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

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.