Forge Home

systemd

A module for managing systemd

7,372 downloads

6,479 latest version

4.6 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

  • 0.0.6 (latest)
  • 0.0.5
  • 0.0.4
  • 0.0.3
  • 0.0.2
  • 0.0.1
released Mar 7th 2017
This version is compatible with:
  • ArchLinux, ,

Start using this module

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

Add this module to your Puppetfile:

mod 'jarro2783-systemd', '0.0.6'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

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

Manually install this module globally with Puppet module tool:

puppet module install jarro2783-systemd --version 0.0.6

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

jarro2783/systemd — version 0.0.6 Mar 7th 2017

Puppet Systemd Module

This is a Puppet module for managing systemd units.

Warning: This module is only Puppet 4 compatible.

This is a work in progress.

Usage

You should include systemd somewhere, and then you will have access to the $::systemd fact, and the resources systemd::service, systemd::dropin, and systemd::timer.

By including the systemd module, the Exec['systemctl-daemon-reload'] resource will be defined. It is defined to come before every service, so that defining a new service or modifying an existing one will reload the definition before starting the service.

Service

To define a service, use the systemd::service resource. It only takes one mandatory parameter, which is $exec_start. This is the command that will be executed to start the service.

To define a basic service that runs some executable, just do:

systemd::service { 'foo':
    exec_start => '/usr/bin/foo',
}

Timer

A timer starts a service after some specified time. To create a timer for service foo that runs daily do:

systemd::timer { 'foo':
    ensure      => 'enabled',
    on_calendar => 'daily',
}

or if you want to call the puppet resource something else, you can use the unit parameter:

systemd::timer { 'foo_timer':
    ensure      => 'enabled',
    on_calendar => 'daily',
    unit        => 'foo',
}

Drop in

A systemd drop in file allows you to override some parameters of a service. Due to the complicated way that parameters need to be overridden, rather than the systemd::dropin resource taking parameters, it just takes the content of the drop in.

systemd::dropin { 'foo_start':
    content => "ExecStart=
ExecStart=/usr/local/bin/foo run",
    service => 'foo',
}