Support ubuntu xenial plugins directory

Looks like the location of plugins directory has changed in
ubuntu-xenial. Update manifiest to support both xenial and trusty.

Update service to subscribe to /opt/meetbot this way we don't need to
know which plugins directory is needed when on xenial or trusty.

Change-Id: I70a06093bbb1119aed52627f2a4bf1d07b74cd5b
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2017-12-12 11:07:54 -05:00
parent 81d84046bb
commit 82a00dacba
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
3 changed files with 14 additions and 4 deletions

View File

@ -1,5 +1,6 @@
class meetbot {
include ::httpd
include ::httpd
include ::meetbot::params
# The Apache mod_version module only needs to be enabled on Ubuntu 12.04
# as it comes compiled and enabled by default on newer OS, including CentOS
@ -59,7 +60,7 @@ class meetbot {
require => User['meetbot'],
}
file { '/usr/share/pyshared/supybot/plugins/MeetBot':
file { "${::meetbot::params::plugins_dir}/supybot/plugins/MeetBot":
ensure => directory,
recurse => true,
require => [
@ -69,7 +70,7 @@ class meetbot {
source => '/opt/meetbot/MeetBot',
}
file { '/usr/share/pyshared/supybot/plugins/Bugtracker':
file { "${::meetbot::params::plugins_dir}/supybot/plugins/Bugtracker":
ensure => directory,
recurse => true,
require => [

8
manifests/params.pp Normal file
View File

@ -0,0 +1,8 @@
# Class: meetbot::params
#
class meetbot::params {
$plugins_dir = $::lsbdistcodename ? {
'xenial' => '/usr/lib/python2.7/dist-packages',
default => '/usr/share/pyshared',
}
}

View File

@ -9,6 +9,7 @@ define meetbot::site(
$vhost_name = $::fqdn,
$manage_index = true,
) {
include ::meetbot::params
$varlib = "/var/lib/meetbot/${name}"
$meetbot = "/srv/meetbot-${name}"
@ -123,7 +124,7 @@ define meetbot::site(
File["/etc/init/${name}-meetbot.conf"]
],
subscribe => [
File['/usr/share/pyshared/supybot/plugins/MeetBot'],
File["${::meetbot::params::plugins_dir}/supybot/plugins/MeetBot"],
File["${varlib}/ircmeeting"]
],
}