Gehel has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/341303 )

Change subject: elasticsearch - move management of plugin directory symlink to 
role classes
......................................................................

elasticsearch - move management of plugin directory symlink to role classes

The plugins to deploy (and their deployment directory) is defined outside
of the main elasticsearch class. As such any symlink related to manage the
plugins needs to move the the role classes as well. Some more cleanup will
be possible once we drop support for elasticsearch 2.x in our puppet code.

Change-Id: I6ec6856165c6e86c7f50f9e8d86b132a06932bd4
---
M modules/elasticsearch/manifests/init.pp
M modules/role/manifests/elasticsearch/common.pp
M modules/role/manifests/logstash/elasticsearch.pp
3 files changed, 26 insertions(+), 11 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/03/341303/1

diff --git a/modules/elasticsearch/manifests/init.pp 
b/modules/elasticsearch/manifests/init.pp
index 006fd53..880ef30 100644
--- a/modules/elasticsearch/manifests/init.pp
+++ b/modules/elasticsearch/manifests/init.pp
@@ -147,15 +147,6 @@
         java_package => $java_package,
     }
 
-    # Elasticsearch 5 doesn't allow setting the plugin path, we need
-    # to symlink it into place. The directory already exists as part of the
-    # debian package, so we need to force the creation of the symlink.
-    file { '/usr/share/elasticsearch/plugins':
-        ensure => 'link',
-        target => $plugins_dir,
-        force  => true,
-    }
-
     file { '/etc/elasticsearch/elasticsearch.yml':
         ensure  => file,
         owner   => 'root',
diff --git a/modules/role/manifests/elasticsearch/common.pp 
b/modules/role/manifests/elasticsearch/common.pp
index 20d97d2..616bf5d 100644
--- a/modules/role/manifests/elasticsearch/common.pp
+++ b/modules/role/manifests/elasticsearch/common.pp
@@ -51,10 +51,22 @@
     package { 'elasticsearch/plugins':
         provider => 'trebuchet',
     }
+    # Elasticsearch 5 doesn't allow setting the plugin path, we need
+    # to symlink it into place. The directory already exists as part of the
+    # debian package, so we need to force the creation of the symlink.
+    file { '/usr/share/elasticsearch/plugins':
+      ensure  => 'link',
+      target  => '/srv/deployment/elasticsearch/plugins/',
+      force   => true,
+      require => Package['elasticsearch/plugins'],
+    }
 
     # Install
     class { '::elasticsearch':
-        require                    => Package['elasticsearch/plugins'],
+        require                    => [
+            Package['elasticsearch/plugins'],
+            File['/usr/share/elasticsearch/plugins'],
+        ],
         # Production elasticsearch needs these plugins to be loaded in order
         # to work properly.  This will keep elasticsearch from starting
         # if these plugins are  not available.
diff --git a/modules/role/manifests/logstash/elasticsearch.pp 
b/modules/role/manifests/logstash/elasticsearch.pp
index 8cbcca1..30d2336 100644
--- a/modules/role/manifests/logstash/elasticsearch.pp
+++ b/modules/role/manifests/logstash/elasticsearch.pp
@@ -16,9 +16,21 @@
     package { 'elasticsearch/plugins':
         provider => 'trebuchet',
     }
+    # Elasticsearch 5 doesn't allow setting the plugin path, we need
+    # to symlink it into place. The directory already exists as part of the
+    # debian package, so we need to force the creation of the symlink.
+    file { '/usr/share/elasticsearch/plugins':
+      ensure  => 'link',
+      target  => '/srv/deployment/elasticsearch/plugins/',
+      force   => true,
+      require => Package['elasticsearch/plugins'],
+    }
 
     class { '::elasticsearch':
-        require      => Package['elasticsearch/plugins'],
+      require => [
+          Package['elasticsearch/plugins'],
+          File['/usr/share/elasticsearch/plugins'],
+      ],
     }
 
     $logstash_nodes = hiera('logstash::cluster_hosts')

-- 
To view, visit https://gerrit.wikimedia.org/r/341303
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6ec6856165c6e86c7f50f9e8d86b132a06932bd4
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Gehel <guillaume.leder...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to