From 82a00dacba54d0c1822ab3a25aa1e4e3f0b2fc9a Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Tue, 12 Dec 2017 11:07:54 -0500 Subject: [PATCH] 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 --- manifests/init.pp | 7 ++++--- manifests/params.pp | 8 ++++++++ manifests/site.pp | 3 ++- 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 manifests/params.pp diff --git a/manifests/init.pp b/manifests/init.pp index f00858f..d116f8b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 => [ diff --git a/manifests/params.pp b/manifests/params.pp new file mode 100644 index 0000000..6de4af4 --- /dev/null +++ b/manifests/params.pp @@ -0,0 +1,8 @@ +# Class: meetbot::params +# +class meetbot::params { + $plugins_dir = $::lsbdistcodename ? { + 'xenial' => '/usr/lib/python2.7/dist-packages', + default => '/usr/share/pyshared', + } +} diff --git a/manifests/site.pp b/manifests/site.pp index 249bb0f..f3bd1d4 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -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"] ], }