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

Change subject: puppetdb: add major version and package variant parameters
......................................................................

puppetdb: add major version and package variant parameters

Add parameters to support different versions of puppetdb.

puppetdb_major_version   - major version of puppetdb to configure
puppetdb_package_variant - variant of package (e.g. debian, puppetlabs) to
                           deploy and configure

Near term these are meant to facilitate a parallel upgrade of puppetdb.
Longer term they should be helpful in selecting between puppetdb packages
from different maintainers which share the same name (e.g. puppetlabs or
debian packages).

Bug: T185501
Change-Id: I0e19c279e295ca097d8ecc6d9396ec931221752a
---
M modules/profile/manifests/puppetdb.pp
M modules/puppetdb/manifests/app.pp
M modules/puppetmaster/manifests/puppetdb.pp
3 files changed, 31 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/08/405808/1

diff --git a/modules/profile/manifests/puppetdb.pp 
b/modules/profile/manifests/puppetdb.pp
index 7c9bea8..56adfad 100644
--- a/modules/profile/manifests/puppetdb.pp
+++ b/modules/profile/manifests/puppetdb.pp
@@ -3,17 +3,22 @@
     $puppetmasters = hiera('puppetmaster::servers'),
     $jvm_opts = hiera('profile::puppetdb::jvm_opts', '-Xmx4G'),
     $prometheus_nodes = hiera('prometheus_nodes'),
+    $puppetdb_major_version = hiera('puppetdb_major_version', undef),
+    $puppetdb_package_variant = hiera('puppetdb_package_variant', undef),
 ) {
+
     # Prometheus JMX agent for the Puppetdb's JVM
     $jmx_exporter_config_file = 
'/etc/puppetdb/jvm_prometheus_puppetdb_jmx_exporter.yaml'
     $prometheus_jmx_exporter_port = 9400
     $prometheus_java_opts = 
"-javaagent:/usr/share/java/prometheus/jmx_prometheus_javaagent.jar=${::ipaddress}:${prometheus_jmx_exporter_port}:${jmx_exporter_config_file}"
+
     # The JVM heap size has been raised to 6G for T170740
     class { '::puppetmaster::puppetdb':
-        master   => $master,
-        jvm_opts => "${jvm_opts} ${prometheus_java_opts}",
+        master                   => $master,
+        jvm_opts                 => "${jvm_opts} ${prometheus_java_opts}",
+        puppetdb_major_version   => $puppetdb_major_version,
+        puppetdb_package_variant => $puppetdb_package_variant,
     }
-
 
     # Export JMX metrics to prometheus
     profile::prometheus::jmx_exporter { "puppetdb_${::hostname}":
@@ -23,7 +28,6 @@
         config_file      => $jmx_exporter_config_file,
         source           => 
'puppet:///modules/profile/puppetmaster/puppetdb/jvm_prometheus_puppetdb_jmx_exporter.yaml',
     }
-
 
     # Firewall rules
 
@@ -42,4 +46,5 @@
         port   => 443,
         srange => '$CUMIN_MASTERS',
     }
+
 }
diff --git a/modules/puppetdb/manifests/app.pp 
b/modules/puppetdb/manifests/app.pp
index 1b64d57..32f9d75 100644
--- a/modules/puppetdb/manifests/app.pp
+++ b/modules/puppetdb/manifests/app.pp
@@ -1,8 +1,18 @@
 # ==  Class puppetdb::app
 #
 # Sets up the puppetdb clojure app.
-# This assumes you're using
+# This assumes you're using ...magic!
 #
+# === Parameters
+#
+# [*puppetdb_major_version*]
+#   Major version of puppetdb to configure.
+#   values: 4 or undef (default)
+#
+# [*puppetdb_package_variant*]
+#   Package(er) variant.
+#   values: "puppetlabs" or undef (default)
+
 class puppetdb::app(
     $db_rw_host,
     $ca_path='/etc/ssl/certs/Puppet_Internal_CA.pem',
@@ -15,6 +25,8 @@
     $bind_ip=undef,
     $ssldir=puppet_ssldir(),
     $command_processing_threads=16,
+    $puppetdb_major_version=undef,
+    $puppetdb_package_variant=undef,
 ) {
     requires_os('debian >= jessie')
 
diff --git a/modules/puppetmaster/manifests/puppetdb.pp 
b/modules/puppetmaster/manifests/puppetdb.pp
index 5f88710..a941e10 100644
--- a/modules/puppetmaster/manifests/puppetdb.pp
+++ b/modules/puppetmaster/manifests/puppetdb.pp
@@ -6,6 +6,8 @@
     $port       = 443,
     $jetty_port = 8080,
     $jvm_opts   ='-Xmx4G',
+    $puppetdb_major_version=undef,
+    $puppetdb_package_variant=undef,
 ) {
     requires_os('debian >= jessie')
 
@@ -34,10 +36,12 @@
     ## PuppetDB installation
 
     class { 'puppetdb::app':
-        db_rw_host  => $master,
-        db_ro_host  => $::fqdn,
-        db_password => $puppetdb_pass,
-        perform_gc  => ($master == $::fqdn), # only the master must perform GC
-        jvm_opts    => $jvm_opts,
+        db_rw_host               => $master,
+        db_ro_host               => $::fqdn,
+        db_password              => $puppetdb_pass,
+        perform_gc               => ($master == $::fqdn), # only the master 
must perform GC
+        jvm_opts                 => $jvm_opts,
+        puppetdb_major_version   => $puppetdb_major_version,
+        puppetdb_package_variant => $puppetdb_package_variant,
     }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e19c279e295ca097d8ecc6d9396ec931221752a
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Herron <kher...@wikimedia.org>

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

Reply via email to