Skip to content

Commit

Permalink
Merge pull request #29 from petems/add_service_management_example
Browse files Browse the repository at this point in the history
(doc) Adds examples of running the service created
  • Loading branch information
bastelfreak authored Oct 17, 2017
2 parents 38a9e08 + 5765ab6 commit 531e380
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Let this module handle file creation and systemd reloading.
```puppet
::systemd::unit_file { 'foo.service':
source => "puppet:///modules/${module_name}/foo.service",
} ~> service {'foo':
ensure => 'running',
}
```

Expand All @@ -32,8 +34,12 @@ file { '/usr/lib/systemd/system/foo.service':
group => 'root',
mode => '0644',
source => "puppet:///modules/${module_name}/foo.service",
} ~> Class['systemd::systemctl::daemon_reload']
service {'foo':
ensure => 'running',
subscribe => File['/usr/lib/systemd/system/foo.service'],
}
~> Class['systemd::systemctl::daemon_reload']
```

### drop-in files
Expand All @@ -46,6 +52,8 @@ directory creation and systemd reloading:
::systemd::dropin_file { 'foo.conf':
unit => 'foo.service',
source => "puppet:///modules/${module_name}/foo.conf",
} ~> service {'foo':
ensure => 'running',
}
```

Expand All @@ -59,14 +67,19 @@ file { '/etc/systemd/system/foo.service.d':
owner => 'root',
group => 'root',
}
file { '/etc/systemd/system/foo.service.d/foo.conf':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
source => "puppet:///modules/${module_name}/foo.conf",
} ~> Class['systemd::systemctl::daemon_reload']
service {'foo':
ensure => 'running',
subscribe => File['/etc/systemd/system/foo.service.d/foo.conf'],
}
~> Class['systemd::systemctl::daemon_reload']
```

### tmpfiles
Expand Down

0 comments on commit 531e380

Please sign in to comment.