Tim Landscheidt has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/340461 )

Change subject: puppet: Make standalone puppetmasters optionally use PuppetDB
......................................................................

puppet: Make standalone puppetmasters optionally use PuppetDB

Bug: T153577
Change-Id: If0f20722a163c9edbf6ab656b66da20b0fc9757b
---
M modules/role/manifests/puppetmaster/standalone.pp
1 file changed, 22 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/61/340461/1

diff --git a/modules/role/manifests/puppetmaster/standalone.pp 
b/modules/role/manifests/puppetmaster/standalone.pp
index 8fd8516..6c6049c 100644
--- a/modules/role/manifests/puppetmaster/standalone.pp
+++ b/modules/role/manifests/puppetmaster/standalone.pp
@@ -33,6 +33,8 @@
 #  Hostname for the puppetmaster. Defaults to fqdn. Is used for SSL
 #  certificates, virtualhost routing, etc
 #
+# [*use_puppetdb*]
+#  Set to true to use PuppetDB.  Defaults to false.
 # filtertags: labs-common
 class role::puppetmaster::standalone(
     $autosign = false,
@@ -42,6 +44,7 @@
     $extra_auth_rules = '',
     $server_name = $::fqdn,
     $use_enc = true,
+    $use_puppetdb = false,
 ) {
     if ! $use_enc {
         fail('Ldap puppet node definitions are no longer supported.  The 
$use_enc param must be true.')
@@ -68,11 +71,21 @@
         group  => 'root',
     }
 
-    $config = {
+    $base_config = {
         'node_terminus'     => 'exec',
         'external_nodes'    => '/usr/local/bin/puppet-enc',
         'thin_storeconfigs' => false,
         'autosign'          => $autosign,
+    }
+    $puppetdb_config = {
+        'storeconfigs'         => true,
+        'storeconfigs_backend' => 'puppetdb',
+    }
+
+    if $use_puppetdb {
+        $config = merge($base_config, $puppetdb_config)
+    } else {
+        $config = $base_config
     }
 
     class { '::puppetmaster':
@@ -84,6 +97,14 @@
         config              => $config,
     }
 
+    if $use_puppetdb {
+        $puppetdb_host = hiera('puppetmaster::config::puppetdb_host')
+
+        class { 'puppetmaster::puppetdb::client':
+            host => $puppetdb_host,
+        }
+    }
+
     # Update git checkout
     class { 'puppetmaster::gitsync':
         run_every_minutes => $git_sync_minutes,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If0f20722a163c9edbf6ab656b66da20b0fc9757b
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Tim Landscheidt <t...@tim-landscheidt.de>

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

Reply via email to