falkorlib 0.7.8 → 0.7.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,6 @@
1
+ ################################################################################
2
+ # Time-stamp: <Wed 2017-08-23 15:14 svarrette>
3
+ #
1
4
  # File:: <tt>common.pp</tt>
2
5
  # Author:: <%= config[:author] %> (<%= config[:mail] %>)
3
6
  # Copyright:: Copyright (c) <%= Time.now.year %> <%= config[:author] %>
@@ -9,119 +12,155 @@
9
12
  # Base class to be inherited by the other <%= config[:shortname] %> classes, containing the common code.
10
13
  #
11
14
  # Note: respect the Naming standard provided here[http://projects.puppetlabs.com/projects/puppet/wiki/Module_Standards]
12
-
15
+ #
13
16
  class <%= config[:shortname] %>::common {
14
17
 
15
- # Load the variables used in this module. Check the params.pp file
16
- require <%= config[:shortname] %>::params
18
+ # Load the variables used in this module. Check the params.pp file
19
+ require <%= config[:shortname] %>::params
17
20
 
18
- package { '<%= config[:shortname] %>':
19
- name => "${<%= config[:shortname] %>::params::packagename}",
20
- ensure => "${<%= config[:shortname] %>::ensure}",
21
- }
22
- # package { $<%= config[:shortname] %>::params::extra_packages:
23
- # ensure => 'present'
24
- # }
21
+ # Order
22
+ if ($<%= config[:shortname] %>::ensure == 'present') {
23
+ Group['<%= config[:shortname] %>'] -> User['<%= config[:shortname] %>'] -> Package['<%= config[:shortname] %>']
24
+ }
25
+ else {
26
+ Package['<%= config[:shortname] %>'] -> User['<%= config[:shortname] %>'] -> Group['<%= config[:shortname] %>']
27
+ }
25
28
 
26
- if $<%= config[:shortname] %>::ensure == 'present' {
29
+ # Prepare the user and group
30
+ group { '<%= config[:shortname] %>':
31
+ ensure => $<%= config[:shortname] %>::ensure,
32
+ name => <%= config[:shortname] %>::params::group,
33
+ gid => <%= config[:shortname] %>::params::gid,
34
+ }
35
+ user { 'munge':
36
+ ensure => $<%= config[:shortname] %>::ensure,
37
+ name => $<%= config[:shortname] %>::params::username,
38
+ uid => $<%= config[:shortname] %>::params::gid,
39
+ gid => $<%= config[:shortname] %>::params::gid,
40
+ comment => $<%= config[:shortname] %>::params::comment,
41
+ home => $<%= config[:shortname] %>::params::home,
42
+ managehome => true,
43
+ system => true,
44
+ shell => $<%= config[:shortname] %>::params::shell,
45
+ }
27
46
 
28
- # Prepare the log directory
29
- file { "${<%= config[:shortname] %>::params::logdir}":
30
- ensure => 'directory',
31
- owner => "${<%= config[:shortname] %>::params::logdir_owner}",
32
- group => "${<%= config[:shortname] %>::params::logdir_group}",
33
- mode => "${<%= config[:shortname] %>::params::logdir_mode}",
34
- require => Package['<%= config[:shortname] %>'],
35
- }
47
+ package { '<%= config[:shortname] %>':
48
+ name => "${<%= config[:shortname] %>::params::packagename}",
49
+ ensure => "${<%= config[:shortname] %>::ensure}",
50
+ }
51
+ package { $<%= config[:shortname] %>::params::extra_packages:
52
+ ensure => 'present'
53
+ }
36
54
 
37
- # Configuration file
38
- # file { "${<%= config[:shortname] %>::params::configdir}":
39
- # ensure => 'directory',
40
- # owner => "${<%= config[:shortname] %>::params::configdir_owner}",
41
- # group => "${<%= config[:shortname] %>::params::configdir_group}",
42
- # mode => "${<%= config[:shortname] %>::params::configdir_mode}",
43
- # require => Package['<%= config[:shortname] %>'],
44
- # }
45
- # Regular version using file resource
46
- file { '<%= config[:shortname] %>.conf':
47
- path => "${<%= config[:shortname] %>::params::configfile}",
48
- owner => "${<%= config[:shortname] %>::params::configfile_owner}",
49
- group => "${<%= config[:shortname] %>::params::configfile_group}",
50
- mode => "${<%= config[:shortname] %>::params::configfile_mode}",
51
- ensure => "${<%= config[:shortname] %>::ensure}",
52
- #content => template("<%= config[:shortname] %>/<%= config[:shortname] %>conf.erb"),
53
- #source => "puppet:///modules/<%= config[:shortname] %>/<%= config[:shortname] %>.conf",
54
- #notify => Service['<%= config[:shortname] %>'],
55
- require => [
56
- #File["${<%= config[:shortname] %>::params::configdir}"],
57
- Package['<%= config[:shortname] %>']
58
- ],
59
- }
55
+ if $<%= config[:shortname] %>::ensure == 'present' {
60
56
 
61
- # # Concat version -- see https://forge.puppetlabs.com/puppetlabs/concat
62
- # include concat::setup
63
- # concat { "${<%= config[:shortname] %>::params::configfile}":
64
- # warn => false,
65
- # owner => "${<%= config[:shortname] %>::params::configfile_owner}",
66
- # group => "${<%= config[:shortname] %>::params::configfile_group}",
67
- # mode => "${<%= config[:shortname] %>::params::configfile_mode}",
68
- # #notify => Service['<%= config[:shortname] %>'],
69
- # require => Package['<%= config[:shortname] %>'],
70
- # }
71
- # # Populate the configuration file
72
- # concat::fragment { "${<%= config[:shortname] %>::params::configfile}_header":
73
- # target => "${<%= config[:shortname] %>::params::configfile}",
74
- # ensure => "${<%= config[:shortname] %>::ensure}",
75
- # content => template("<%= config[:shortname] %>/<%= config[:shortname] %>_header.conf.erb"),
76
- # #source => "puppet:///modules/<%= config[:shortname] %>/<%= config[:shortname] %>_header.conf",
77
- # order => '01',
78
- # }
79
- # concat::fragment { "${<%= config[:shortname] %>::params::configfile}_footer":
80
- # target => "${<%= config[:shortname] %>::params::configfile}",
81
- # ensure => "${<%= config[:shortname] %>::ensure}",
82
- # content => template("<%= config[:shortname] %>/<%= config[:shortname] %>_footer.conf.erb"),
83
- # #source => "puppet:///modules/<%= config[:shortname] %>/<%= config[:shortname] %>_footer.conf",
84
- # order => '99',
85
- # }
57
+ # Prepare the log directory
58
+ file { "${<%= config[:shortname] %>::params::logdir}":
59
+ ensure => 'directory',
60
+ owner => "${<%= config[:shortname] %>::params::logdir_owner}",
61
+ group => "${<%= config[:shortname] %>::params::logdir_group}",
62
+ mode => "${<%= config[:shortname] %>::params::logdir_mode}",
63
+ require => Package['<%= config[:shortname] %>'],
64
+ }
86
65
 
87
- # PID file directory
88
- # file { "${<%= config[:shortname] %>::params::piddir}":
89
- # ensure => 'directory',
90
- # owner => "${<%= config[:shortname] %>::params::piddir_user}",
91
- # group => "${<%= config[:shortname] %>::params::piddir_group}",
92
- # mode => "${<%= config[:shortname] %>::params::piddir_mode}",
93
- # }
66
+ # Configuration file
67
+ file { "${<%= config[:shortname] %>::params::configdir}":
68
+ ensure => 'directory',
69
+ owner => "${<%= config[:shortname] %>::params::configdir_owner}",
70
+ group => "${<%= config[:shortname] %>::params::configdir_group}",
71
+ mode => "${<%= config[:shortname] %>::params::configdir_mode}",
72
+ require => Package['<%= config[:shortname] %>'],
73
+ }
74
+ # Regular version using file resource
75
+ file { '<%= config[:shortname] %>.conf':
76
+ ensure => "${<%= config[:shortname] %>::ensure}",
77
+ path => "${<%= config[:shortname] %>::params::configfile}",
78
+ owner => "${<%= config[:shortname] %>::params::configfile_owner}",
79
+ group => "${<%= config[:shortname] %>::params::configfile_group}",
80
+ mode => "${<%= config[:shortname] %>::params::configfile_mode}",
81
+ #content => template("<%= config[:shortname] %>/<%= config[:shortname] %>conf.erb"),
82
+ #source => "puppet:///modules/<%= config[:shortname] %>/<%= config[:shortname] %>.conf",
83
+ #notify => Service['<%= config[:shortname] %>'],
84
+ require => [
85
+ #File["${<%= config[:shortname] %>::params::configdir}"],
86
+ Package['<%= config[:shortname] %>']
87
+ ],
88
+ }
94
89
 
95
- file { "${<%= config[:shortname] %>::params::configfile_init}":
96
- owner => "${<%= config[:shortname] %>::params::configfile_owner}",
97
- group => "${<%= config[:shortname] %>::params::configfile_group}",
98
- mode => "${<%= config[:shortname] %>::params::configfile_mode}",
99
- ensure => "${<%= config[:shortname] %>::ensure}",
100
- #content => template("<%= config[:shortname] %>/default/<%= config[:shortname] %>.erb"),
101
- #source => "puppet:///modules/<%= config[:shortname] %>/default/<%= config[:shortname] %>.conf",
102
- notify => Service['<%= config[:shortname] %>'],
103
- require => Package['<%= config[:shortname] %>']
104
- }
90
+ # # Concat version -- see https://forge.puppetlabs.com/puppetlabs/concat
91
+ # include concat::setup
92
+ # concat { "${<%= config[:shortname] %>::params::configfile}":
93
+ # warn => false,
94
+ # owner => "${<%= config[:shortname] %>::params::configfile_owner}",
95
+ # group => "${<%= config[:shortname] %>::params::configfile_group}",
96
+ # mode => "${<%= config[:shortname] %>::params::configfile_mode}",
97
+ # #notify => Service['<%= config[:shortname] %>'],
98
+ # require => Package['<%= config[:shortname] %>'],
99
+ # }
100
+ # # Populate the configuration file
101
+ # concat::fragment { "${<%= config[:shortname] %>::params::configfile}_header":
102
+ # ensure => "${<%= config[:shortname] %>::ensure}",
103
+ # target => "${<%= config[:shortname] %>::params::configfile}",
104
+ # content => template("<%= config[:shortname] %>/<%= config[:shortname] %>_header.conf.erb"),
105
+ # #source => "puppet:///modules/<%= config[:shortname] %>/<%= config[:shortname] %>_header.conf",
106
+ # order => '01',
107
+ # }
108
+ # concat::fragment { "${<%= config[:shortname] %>::params::configfile}_footer":
109
+ # ensure => "${<%= config[:shortname] %>::ensure}",
110
+ # target => "${<%= config[:shortname] %>::params::configfile}",
111
+ # content => template("<%= config[:shortname] %>/<%= config[:shortname] %>_footer.conf.erb"),
112
+ # #source => "puppet:///modules/<%= config[:shortname] %>/<%= config[:shortname] %>_footer.conf",
113
+ # order => '99',
114
+ # }
105
115
 
106
- service { '<%= config[:shortname] %>':
107
- name => "${<%= config[:shortname] %>::params::servicename}",
108
- enable => true,
109
- ensure => running,
110
- hasrestart => "${<%= config[:shortname] %>::params::hasrestart}",
111
- pattern => "${<%= config[:shortname] %>::params::processname}",
112
- hasstatus => "${<%= config[:shortname] %>::params::hasstatus}",
113
- require => [
114
- Package['<%= config[:shortname] %>'],
115
- File["${<%= config[:shortname] %>::params::configfile_init}"]
116
- ],
117
- subscribe => File['<%= config[:shortname] %>.conf'],
118
- }
116
+ # PID file directory
117
+ file { "${<%= config[:shortname] %>::params::piddir}":
118
+ ensure => 'directory',
119
+ owner => "${<%= config[:shortname] %>::params::piddir_user}",
120
+ group => "${<%= config[:shortname] %>::params::piddir_group}",
121
+ mode => "${<%= config[:shortname] %>::params::piddir_mode}",
119
122
  }
120
- else
121
- {
122
- # Here $<%= config[:shortname] %>::ensure is 'absent'
123
-
123
+ }
124
+ else
125
+ {
126
+ # Here $<%= config[:shortname] %>::ensure is 'absent'
127
+ file {
128
+ [
129
+ $<%= config[:shortname] %>::params::configdir,
130
+ $<%= config[:shortname] %>::params::logdir,
131
+ $<%= config[:shortname] %>::params::piddir,
132
+ ]:
133
+ ensure => $<%= config[:shortname] %>::ensure,
134
+ force => true,
135
+ }
136
+ }
137
+ # Sysconfig / default daemon directory
138
+ file { "${<%= config[:shortname] %>::params::default_sysconfig}":
139
+ ensure => $<%= config[:shortname] %>::ensure,
140
+ owner => $<%= config[:shortname] %>::params::configfile_owner,
141
+ group => $<%= config[:shortname] %>::params::configfile_group,
142
+ mode => '0755',
143
+ #content => template("<%= config[:shortname] %>/default/<%= config[:shortname] %>.erb"),
144
+ #source => "puppet:///modules/<%= config[:shortname] %>/default/<%= config[:shortname] %>.conf",
145
+ notify => Service['<%= config[:shortname] %>'],
146
+ require => Package['<%= config[:shortname] %>']
124
147
  }
125
148
 
126
- }
149
+ service { '<%= config[:shortname] %>':
150
+ ensure => ($<%= config[:shortname] %>::ensure == 'present'),
151
+ name => "${<%= config[:shortname] %>::params::servicename}",
152
+ enable => ($<%= config[:shortname] %>::ensure == 'present'),
153
+ pattern => "${<%= config[:shortname] %>::params::processname}",
154
+ hasrestart => "${<%= config[:shortname] %>::params::hasrestart}",
155
+ hasstatus => "${<%= config[:shortname] %>::params::hasstatus}",
156
+ require => [
157
+ Package['<%= config[:shortname] %>'],
158
+ File[$<%= config[:shortname] %>::params::configdir],
159
+ File[$<%= config[:shortname] %>::params::logdir],
160
+ File[$<%= config[:shortname] %>::params::piddir],
161
+ File[$<%= config[:shortname] %>::params::configfile_init]
162
+ ],
163
+ subscribe => File['<%= config[:shortname] %>.conf'],
164
+ }
127
165
 
166
+ }
@@ -1,63 +1,66 @@
1
+ ################################################################################
2
+ # Time-stamp: <Wed 2017-08-23 14:49 svarrette>
3
+ #
1
4
  # File:: <tt>init.pp</tt>
2
5
  # Author:: <%= config[:author] %> (<%= config[:mail] %>)
3
6
  # Copyright:: Copyright (c) <%= Time.now.year %> <%= config[:author] %>
4
7
  # License:: <%= config[:license].capitalize %>
5
8
  #
6
9
  # ------------------------------------------------------------------------------
7
- # = Class: <%= config[:shortname] %>
10
+ # == Class: <%= config[:shortname] %>
8
11
  #
9
12
  # <%= config[:summary] %>
10
13
  #
11
- # == Parameters:
12
- #
13
- # $ensure:: *Default*: 'present'. Ensure the presence (or absence) of <%= config[:shortname] %>
14
- #
15
- # == Actions:
16
14
  #
17
- # Install and configure <%= config[:shortname] %>
15
+ # @param ensure [String] Default: 'present'.
16
+ # Ensure the presence (or absence) of <%= config[:shortname] %>
18
17
  #
19
- # == Requires:
18
+ # === Requires
20
19
  #
21
20
  # n/a
22
21
  #
23
- # == Sample Usage:
22
+ # @example Basic instanciation
24
23
  #
25
- # include '<%= config[:shortname] %>'
24
+ # include '::<%= config[:shortname] %>'
26
25
  #
27
26
  # You can then specialize the various aspects of the configuration,
28
27
  # for instance:
29
28
  #
30
- # class { '<%= config[:shortname] %>':
29
+ # class { '::<%= config[:shortname] %>':
31
30
  # ensure => 'present'
32
31
  # }
33
32
  #
34
- # == Warnings
33
+ # === Authors
35
34
  #
36
- # /!\ Always respect the style guide available
37
- # here[http://docs.puppetlabs.com/guides/style_guide]
35
+ # The UL HPC Team <hpc-sysadmins@uni.lu> of the University of Luxembourg, in
36
+ # particular
37
+ # * Sebastien Varrette <Sebastien.Varrette@uni.lu>
38
+ # * Valentin Plugaru <Valentin.Plugaru@uni.lu>
39
+ # * Sarah Peter <Sarah.Peter@uni.lu>
40
+ # * Hyacinthe Cartiaux <Hyacinthe.Cartiaux@uni.lu>
41
+ # * Clement Parisot <Clement.Parisot@uni.lu>
42
+ # See AUTHORS for more details
38
43
  #
44
+ # === Warnings
45
+ #
46
+ # /!\ Always respect the style guide available here[http://docs.puppetlabs.com/guides/style_guide]
39
47
  #
40
48
  # [Remember: No empty lines between comments and class definition]
41
49
  #
42
50
  class <%= config[:shortname] %>(
43
- $ensure = $<%= config[:shortname] %>::params::ensure
51
+ String $ensure = $<%= config[:shortname] %>::params::ensure
44
52
  )
45
53
  inherits <%= config[:shortname] %>::params
46
54
  {
47
- info ("Configuring <%= config[:shortname] %> (with ensure = ${ensure})")
55
+ validate_legacy('String', 'validate_re', $ensure, ['^present', '^absent'])
48
56
 
49
- if ! ($ensure in [ 'present', 'absent' ]) {
50
- fail("<%= config[:shortname] %> 'ensure' parameter must be set to either 'absent' or 'present'")
51
- }
57
+ info ("Configuring <%= config[:shortname] %> (with ensure = ${ensure})")
52
58
 
53
59
  case $::operatingsystem {
54
- debian, ubuntu: { include <%= config[:shortname] %>::common::debian }
55
- redhat, fedora, centos: { include <%= config[:shortname] %>::common::redhat }
60
+ /(?i-mx:ubuntu|debian)/: { include ::<%= config[:shortname] %>::common::debian }
61
+ /(?i-mx:centos|fedora|redhat)/: { include ::<%= config[:shortname] %>::common::redhat }
56
62
  default: {
57
- fail("Module $module_name is not supported on $operatingsystem")
63
+ fail("Module ${module_name} is not supported on ${::operatingsystem}")
58
64
  }
59
65
  }
60
66
  }
61
-
62
-
63
-
@@ -1,3 +1,6 @@
1
+ ################################################################################
2
+ # Time-stamp: <Wed 2017-08-23 14:37 svarrette>
3
+ #
1
4
  # File:: <tt>mydef.pp</tt>
2
5
  # Author:: <%= config[:author] %> (<%= config[:mail] %>)
3
6
  # Copyright:: Copyright (c) <%= Time.now.year %> <%= config[:author] %>
@@ -1,143 +1,150 @@
1
+ ################################################################################
2
+ # Time-stamp: <Wed 2017-08-23 15:15 svarrette>
3
+ #
1
4
  # File:: <tt>params.pp</tt>
2
5
  # Author:: <%= config[:author] %> (<%= config[:mail] %>)
3
6
  # Copyright:: Copyright (c) <%= Time.now.year %> <%= config[:author] %>
4
7
  # License:: <%= config[:license].capitalize %>
5
8
  #
6
9
  # ------------------------------------------------------------------------------
7
- # = Class: <%= config[:shortname] %>::params
10
+ # == Class: <%= config[:shortname] %>::params
8
11
  #
9
12
  # In this class are defined as variables values that are used in other
10
- # <%= config[:shortname] %> classes.
13
+ # <%= config[:shortname] %> classes and definitions.
11
14
  # This class should be included, where necessary, and eventually be enhanced
12
- # with support for more OS
15
+ # with support for more Operating Systems.
13
16
  #
14
17
  # == Warnings
15
18
  #
16
19
  # /!\ Always respect the style guide available
17
20
  # here[http://docs.puppetlabs.com/guides/style_guide]
18
21
  #
19
- # The usage of a dedicated param classe is advised to better deal with
20
- # parametrized classes, see
21
- # http://docs.puppetlabs.com/guides/parameterized_classes.html
22
- #
23
22
  # [Remember: No empty lines between comments and class definition]
24
23
  #
25
24
  class <%= config[:shortname] %>::params {
26
25
 
27
- ######## DEFAULTS FOR VARIABLES USERS CAN SET ##########################
28
- # (Here are set the defaults, provide your custom variables externally)
29
- # (The default used is in the line with '')
30
- ###########################################
26
+ #### MODULE INTERNAL VARIABLES #########
27
+ # (Modify to adapt to unsupported OSes)
28
+ #########################################
29
+
30
+ # ensure the presence (or absence) of <%= config[:shortname] %>
31
+ $ensure = 'present'
31
32
 
32
- # ensure the presence (or absence) of <%= config[:shortname] %>
33
- $ensure = 'present'
33
+ # The Protocol used. Used by monitor and firewall class. Default is 'tcp'
34
+ $protocol = 'tcp'
34
35
 
35
- # The Protocol used. Used by monitor and firewall class. Default is 'tcp'
36
- $protocol = 'tcp'
36
+ # The port number. Used by monitor and firewall class. The default is 22.
37
+ $port = 22
37
38
 
38
- # The port number. Used by monitor and firewall class. The default is 22.
39
- $port = 22
39
+ # example of an array/hash variable
40
+ $array_variable = []
41
+ $hash_variable = {}
40
42
 
41
- # example of an array/hash variable
42
- $array_variable = []
43
- $hash_variable = {}
43
+ # undef variable
44
+ $undefvar = undef
44
45
 
45
- # undef variable
46
- $undefvar = undef
46
+ ###########################################
47
+ # <%= config[:shortname] %> system configs
48
+ ###########################################
49
+ # <%= config[:shortname] %> user / group identifiers
50
+ $username = '<%= config[:shortname] %>'
51
+ $uid = 14144
52
+ $group = $username
53
+ $gid = $uid
54
+ $home = "/var/lib/${username}"
55
+ $comment = '<%= config[:shortname].capitalize %> User'
56
+ $shell = '/sbin/nologin' # or '/bin/bash'
47
57
 
48
- #### MODULE INTERNAL VARIABLES #########
49
- # (Modify to adapt to unsupported OSes)
50
- #######################################
51
- # <%= config[:shortname] %> packages
52
- $packagename = $::operatingsystem ? {
53
- default => '<%= config[:shortname] %>',
54
- }
55
- # $extra_packages = $::operatingsystem ? {
56
- # /(?i-mx:ubuntu|debian)/ => [],
57
- # /(?i-mx:centos|fedora|redhat)/ => [],
58
- # default => []
59
- # }
58
+ # <%= config[:shortname] %> packages
59
+ $packagename = $::operatingsystem ? {
60
+ default => '<%= config[:shortname] %>',
61
+ }
62
+ $extra_packages = $::operatingsystem ? {
63
+ /(?i-mx:ubuntu|debian)/ => [],
64
+ /(?i-mx:centos|fedora|redhat)/ => [],
65
+ default => []
66
+ }
60
67
 
61
- # Log directory
62
- $logdir = $::operatingsystem ? {
63
- default => '/var/log/<%= config[:shortname] %>'
64
- }
65
- $logdir_mode = $::operatingsystem ? {
66
- default => '750',
67
- }
68
- $logdir_owner = $::operatingsystem ? {
69
- default => 'root',
70
- }
71
- $logdir_group = $::operatingsystem ? {
72
- default => 'adm',
73
- }
68
+ # Log directory
69
+ $logdir = $::operatingsystem ? {
70
+ default => '/var/log/<%= config[:shortname] %>'
71
+ }
72
+ $logdir_mode = $::operatingsystem ? {
73
+ default => '750',
74
+ }
75
+ $logdir_owner = $::operatingsystem ? {
76
+ default => 'root',
77
+ }
78
+ $logdir_group = $::operatingsystem ? {
79
+ default => 'adm',
80
+ }
74
81
 
75
- # PID for daemons
76
- # $piddir = $::operatingsystem ? {
77
- # default => "/var/run/<%= config[:shortname] %>",
78
- # }
79
- # $piddir_mode = $::operatingsystem ? {
80
- # default => '750',
81
- # }
82
- # $piddir_owner = $::operatingsystem ? {
83
- # default => '<%= config[:shortname] %>',
84
- # }
85
- # $piddir_group = $::operatingsystem ? {
86
- # default => 'adm',
87
- # }
88
- # $pidfile = $::operatingsystem ? {
89
- # default => '/var/run/<%= config[:shortname] %>/<%= config[:shortname] %>.pid'
90
- # }
82
+ # PID for daemons
83
+ $piddir = $::operatingsystem ? {
84
+ default => "/var/run/<%= config[:shortname] %>",
85
+ }
86
+ $piddir_mode = $::operatingsystem ? {
87
+ default => '750',
88
+ }
89
+ $piddir_owner = $::operatingsystem ? {
90
+ default => '<%= config[:shortname] %>',
91
+ }
92
+ $piddir_group = $::operatingsystem ? {
93
+ default => 'adm',
94
+ }
95
+ $pidfile = $::operatingsystem ? {
96
+ default => '/var/run/<%= config[:shortname] %>/<%= config[:shortname] %>.pid'
97
+ }
91
98
 
92
- # <%= config[:shortname] %> associated services
93
- $servicename = $::operatingsystem ? {
94
- /(?i-mx:ubuntu|debian)/ => '<%= config[:shortname] %>',
95
- default => '<%= config[:shortname] %>'
96
- }
97
- # used for pattern in a service ressource
98
- $processname = $::operatingsystem ? {
99
- /(?i-mx:ubuntu|debian)/ => '<%= config[:shortname] %>',
100
- default => '<%= config[:shortname] %>'
101
- }
102
- $hasstatus = $::operatingsystem ? {
103
- /(?i-mx:ubuntu|debian)/ => false,
104
- /(?i-mx:centos|fedora|redhat)/ => true,
105
- default => true,
106
- }
107
- $hasrestart = $::operatingsystem ? {
108
- default => true,
109
- }
99
+ # <%= config[:shortname] %> associated services
100
+ $servicename = $::operatingsystem ? {
101
+ /(?i-mx:ubuntu|debian)/ => '<%= config[:shortname] %>',
102
+ default => '<%= config[:shortname] %>'
103
+ }
104
+ # used for pattern in a service ressource
105
+ $processname = $::operatingsystem ? {
106
+ /(?i-mx:ubuntu|debian)/ => '<%= config[:shortname] %>',
107
+ default => '<%= config[:shortname] %>'
108
+ }
109
+ $hasstatus = $::operatingsystem ? {
110
+ /(?i-mx:ubuntu|debian)/ => false,
111
+ /(?i-mx:centos|fedora|redhat)/ => true,
112
+ default => true,
113
+ }
114
+ $hasrestart = $::operatingsystem ? {
115
+ default => true,
116
+ }
110
117
 
111
- # Configuration directory & file
112
- # $configdir = $::operatingsystem ? {
113
- # default => "/etc/<%= config[:shortname] %>",
114
- # }
115
- # $configdir_mode = $::operatingsystem ? {
116
- # default => '0755',
117
- # }
118
- # $configdir_owner = $::operatingsystem ? {
119
- # default => 'root',
120
- # }
121
- # $configdir_group = $::operatingsystem ? {
122
- # default => 'root',
123
- # }
118
+ # Configuration directory & file
119
+ $configdir = $::operatingsystem ? {
120
+ default => "/etc/<%= config[:shortname] %>",
121
+ }
122
+ $configdir_mode = $::operatingsystem ? {
123
+ default => '0755',
124
+ }
125
+ $configdir_owner = $::operatingsystem ? {
126
+ default => 'root',
127
+ }
128
+ $configdir_group = $::operatingsystem ? {
129
+ default => 'root',
130
+ }
124
131
 
125
- $configfile = $::operatingsystem ? {
126
- default => '/etc/<%= config[:shortname] %>.conf',
127
- }
128
- $configfile_init = $::operatingsystem ? {
129
- /(?i-mx:ubuntu|debian)/ => '/etc/default/<%= config[:shortname] %>',
130
- default => '/etc/sysconfig/<%= config[:shortname] %>'
131
- }
132
- $configfile_mode = $::operatingsystem ? {
133
- default => '0600',
134
- }
135
- $configfile_owner = $::operatingsystem ? {
136
- default => 'root',
137
- }
138
- $configfile_group = $::operatingsystem ? {
139
- default => 'root',
140
- }
132
+ $configfile = $::operatingsystem ? {
133
+ default => '/etc/<%= config[:shortname] %>.conf',
134
+ }
135
+ $configfile_mode = $::operatingsystem ? {
136
+ default => '0600',
137
+ }
138
+ $configfile_owner = $::operatingsystem ? {
139
+ default => 'root',
140
+ }
141
+ $configfile_group = $::operatingsystem ? {
142
+ default => 'root',
143
+ }
141
144
 
145
+ $default_sysconfig = $::operatingsystem ? {
146
+ /(?i-mx:ubuntu|debian)/ => '/etc/default/<%= config[:shortname] %>',
147
+ default => '/etc/sysconfig/<%= config[:shortname] %>'
148
+ }
142
149
 
143
150
  }