|
113 | 113 | }
|
114 | 114 | }
|
115 | 115 |
|
116 |
| - # Figure out which service provider (init system) we should be using. |
117 |
| - # In general, we'll try to guess based on the operating system. |
118 |
| - $os = downcase($facts['os']['name']) |
119 |
| - $release = $facts['os']['release']['major'] |
120 |
| - # However, the operator may have explicitly defined the service provider. |
121 |
| - if($logstash::service_provider) { |
122 |
| - $service_provider = $logstash::service_provider |
123 |
| - } |
124 |
| - # In the absence of an explicit choice, we'll try to figure out a sensible |
125 |
| - # default. |
126 |
| - # Puppet 3 doesn't know that Debian 8 uses systemd, not SysV init, so we'll |
127 |
| - # help it out with our knowledge from the future. |
128 |
| - elsif($os == 'debian' and $release == '8') { |
129 |
| - $service_provider = 'systemd' |
130 |
| - } |
131 |
| - # RedHat/CentOS/OEL 6 uses Upstart by default, but Puppet can get confused about this too. |
132 |
| - elsif($os =~ /(redhat|centos|oraclelinux)/ and $release == '6') { |
133 |
| - $service_provider = 'upstart' |
134 |
| - } |
135 |
| - elsif($os =~ /ubuntu/ and $release == '12.04') { |
136 |
| - $service_provider = 'upstart' |
137 |
| - } |
138 |
| - elsif($os =~ /opensuse/ and $release == '13') { |
139 |
| - $service_provider = 'systemd' |
140 |
| - } |
141 |
| - #Older Amazon Linux AMIs has its release based on the year |
142 |
| - #it came out (2010 and up); the provider needed to be set explicitly; |
143 |
| - #New Amazon Linux 2 AMIs has the release set to 2, Puppet can handle it |
144 |
| - elsif($os =~ /amazon/ and versioncmp($release, '2000') > 0) { |
145 |
| - $service_provider = 'upstart' |
146 |
| - } |
147 |
| - else { |
148 |
| - # In most cases, Puppet(4) can figure out the correct service |
149 |
| - # provider on its own, so we'll just say 'undef', and let it do |
150 |
| - # whatever it thinks is best. |
151 |
| - $service_provider = undef |
152 |
| - } |
153 |
| - |
154 | 116 | service { 'logstash':
|
155 | 117 | ensure => $service_ensure,
|
156 | 118 | enable => $service_enable,
|
157 | 119 | hasstatus => true,
|
158 | 120 | hasrestart => true,
|
159 |
| - provider => $service_provider, |
| 121 | + provider => $logstash::service_provider, |
160 | 122 | }
|
161 | 123 |
|
162 | 124 | # If any files tagged as config files for the service are changed, notify
|
|
0 commit comments