0.5
app-cordova
debian/bullseye
debian/jessie
|
Last change
on this file since 6cce084 was 22f7269, checked in by Joachim Langenbach <joachim.langenbach@…>, 10 years ago |
|
Updated puppet config
|
-
Property mode
set to
100644
|
|
File size:
1.3 KB
|
| Line | |
|---|
| 1 | class gnuboat_gpsd::service
|
|---|
| 2 | (
|
|---|
| 3 | Enum['running', 'stopped'] $status = 'running',
|
|---|
| 4 | Boolean $enabled = true,
|
|---|
| 5 | Boolean $usb_auto = true,
|
|---|
| 6 | String $devices = '/dev/ttyAMA0',
|
|---|
| 7 | Boolean $network_access = false,
|
|---|
| 8 | )
|
|---|
| 9 | inherits gnuboat_gpsd
|
|---|
| 10 | {
|
|---|
| 11 | service{'gpsd':
|
|---|
| 12 | ensure => $status,
|
|---|
| 13 | enable => $enabled,
|
|---|
| 14 | subscribe => Package['gpsd'],
|
|---|
| 15 | }
|
|---|
| 16 |
|
|---|
| 17 | if(!$network_access)
|
|---|
| 18 | {
|
|---|
| 19 | $options = ''
|
|---|
| 20 | }
|
|---|
| 21 | else
|
|---|
| 22 | {
|
|---|
| 23 | $options = '-G'
|
|---|
| 24 | $listen_stream = '0.0.0.0:2947'
|
|---|
| 25 | file{'/etc/systemd/system/gpsd.socket':
|
|---|
| 26 | ensure => present,
|
|---|
| 27 | owner => 'root',
|
|---|
| 28 | group => 'root',
|
|---|
| 29 | mode => '0600',
|
|---|
| 30 | notify => [Exec['systemctl-daemon-reload'], Service['gpsd']],
|
|---|
| 31 | content => epp('gnuboat_gpsd/gpsd.socket.epp',
|
|---|
| 32 | {
|
|---|
| 33 | 'listen_stream' => $listen_stream,
|
|---|
| 34 | }),
|
|---|
| 35 | }
|
|---|
| 36 |
|
|---|
| 37 | # Hack as puppet does not call systemctl daemon-reload, if needed until now (2017-04-28)
|
|---|
| 38 | exec{'systemctl-daemon-reload':
|
|---|
| 39 | command => 'systemctl daemon-reload',
|
|---|
| 40 | path => '/bin:/usr/bin',
|
|---|
| 41 | }
|
|---|
| 42 | }
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 | file{'/etc/default/gpsd':
|
|---|
| 46 | ensure => present,
|
|---|
| 47 | owner => 'root',
|
|---|
| 48 | group => 'root',
|
|---|
| 49 | mode => '0600',
|
|---|
| 50 | notify => Service['gpsd'],
|
|---|
| 51 | content => epp('gnuboat_gpsd/gpsd.epp',
|
|---|
| 52 | {
|
|---|
| 53 | 'enabled' => $enabled,
|
|---|
| 54 | 'usb_auto' => $usb_auto,
|
|---|
| 55 | 'devices' => $devices,
|
|---|
| 56 | 'options' => $options,
|
|---|
| 57 | }),
|
|---|
| 58 | }
|
|---|
| 59 |
|
|---|
| 60 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.