Version information
This version is compatible with:
- ArchLinux, ,
Start using this module
Add this module to your Puppetfile:
mod 'jarro2783-systemd', '0.0.6'
Learn more about managing modules with a PuppetfileDocumentation
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',
}