From a0e5de9275bc9a83c0e37b457f12607527b90d96 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Tue, 4 Aug 2015 10:28:47 +0200 Subject: Add 'systemd-tmpfiles-create' --- README.md | 26 +++++++++++++++++++++----- manifests/init.pp | 14 ++++++++++++-- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 283ebdb..f70bcb0 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ -Systemd -======= +# Systemd [![Puppet Forge](http://img.shields.io/puppetforge/v/camptocamp/systemd.svg)](https://forge.puppetlabs.com/camptocamp/systemd) [![Build Status](https://travis-ci.org/camptocamp/puppet-systemd.png?branch=master)](https://travis-ci.org/camptocamp/puppet-systemd) -Overview --------- +## Overview -This module just declares an `Exec['systemctl-daemon-reload']` resource that you can use to refresh the daemon. +This module declares exec resources that you can use when you change systemd units or configuration files. + +## Examples + +### systemctl --daemon-reload ```puppet include ::systemd @@ -20,3 +22,17 @@ file { '/usr/lib/systemd/system/foo.service': } ~> Exec['systemctl-daemon-reload'] ``` + +### systemd-tmpfiles --create + +```puppet +include ::systemd +file { '/etc/tmpfiles.d/foo.conf': + ensure => file, + owner => 'root', + group => 'root', + mode => '0644', + source => "puppet:///modules/${module_name}/foo.conf", +} ~> +Exec['systemd-tmpfiles-create'] +``` diff --git a/manifests/init.pp b/manifests/init.pp index b466c64..5e6ad79 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,8 +1,18 @@ class systemd { - exec { 'systemctl-daemon-reload': - command => 'systemctl daemon-reload', + Exec { refreshonly => true, path => $::path, } + + exec { + 'systemctl-daemon-reload': + command => 'systemctl daemon-reload', + } + + exec { + 'systemd-tmpfiles-create': + command => 'systemd-tmpfiles --create', + } + } -- cgit v1.2.3