Forge Home

systemd

A module for managing systemd

7,543 downloads

6,563 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.

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.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',
}