[MediaWiki-commits] [Gerrit] switch nagios private contacts to secret() - change (operations/puppet)

2015-07-27 Thread BBlack (Code Review)
BBlack has submitted this change and it was merged.

Change subject: switch nagios private contacts to secret()
..


switch nagios private contacts to secret()

Change-Id: I5a5e88d341230907b9082a2da809ce9cb16d2f4c
---
M modules/icinga/manifests/init.pp
M modules/nagios_common/manifests/contacts.pp
2 files changed, 10 insertions(+), 9 deletions(-)

Approvals:
  BBlack: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/icinga/manifests/init.pp b/modules/icinga/manifests/init.pp
index 9c41169..34a4e7c 100644
--- a/modules/icinga/manifests/init.pp
+++ b/modules/icinga/manifests/init.pp
@@ -78,7 +78,7 @@
 }
 
 class { 'nagios_common::contacts':
-source  => 'puppet:///private/nagios/contacts.cfg',
+content => secret('nagios/contacts.cfg'),
 require => Package['icinga'],
 notify  => Service['icinga'],
 }
diff --git a/modules/nagios_common/manifests/contacts.pp 
b/modules/nagios_common/manifests/contacts.pp
index 573ed43..aa78141 100644
--- a/modules/nagios_common/manifests/contacts.pp
+++ b/modules/nagios_common/manifests/contacts.pp
@@ -10,12 +10,6 @@
 #   The base directory to put configuration directory in.
 #   Defaults to '/etc/icinga/'
 #
-# [*source*]
-#   Optional - allows to input a prewritten file as a source.
-# [*template*]
-#   puppet URL specifying the template of the contacts.cfg file
-#   Defaults to 'nagios_common/contacts.cfg.erb'
-#
 # [*owner*]
 #   The user which should own the check config files.
 #   Defaults to 'icinga'
@@ -27,11 +21,18 @@
 # [*contacts*]
 #   The list of contacts to include in the configuration.
 #
+# [*source*]
+#   Allows to input a prewritten file as a source.  Overrides "content" if
+#   defined, but "content" is used if this is undefined.
+# [*content*]
+#   Allows to input the data as a content string.  The default is
+#   template('nagios_common/contacts.cfg.erb')
+#
 class nagios_common::contacts(
 $ensure = present,
 $config_dir = '/etc/icinga',
 $source = undef,
-$template = 'nagios_common/contacts.cfg.erb',
+$content = template('nagios_common/contacts.cfg.erb'),
 $owner = 'icinga',
 $group = 'icinga',
 $contacts = [],
@@ -47,7 +48,7 @@
 } else {
 file { "${config_dir}/contacts.cfg":
 ensure  => $ensure,
-content => template($template),
+content => $content,
 owner   => $owner,
 group   => $group,
 mode=> '0600', # Only $owner:$group can read/write

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5a5e88d341230907b9082a2da809ce9cb16d2f4c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack 
Gerrit-Reviewer: BBlack 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] switch nagios private contacts to secret() - change (operations/puppet)

2015-07-27 Thread BBlack (Code Review)
BBlack has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/227227

Change subject: switch nagios private contacts to secret()
..

switch nagios private contacts to secret()

Change-Id: I5a5e88d341230907b9082a2da809ce9cb16d2f4c
---
M modules/icinga/manifests/init.pp
M modules/nagios_common/manifests/contacts.pp
2 files changed, 10 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/27/227227/1

diff --git a/modules/icinga/manifests/init.pp b/modules/icinga/manifests/init.pp
index 9c41169..34a4e7c 100644
--- a/modules/icinga/manifests/init.pp
+++ b/modules/icinga/manifests/init.pp
@@ -78,7 +78,7 @@
 }
 
 class { 'nagios_common::contacts':
-source  => 'puppet:///private/nagios/contacts.cfg',
+content => secret('nagios/contacts.cfg'),
 require => Package['icinga'],
 notify  => Service['icinga'],
 }
diff --git a/modules/nagios_common/manifests/contacts.pp 
b/modules/nagios_common/manifests/contacts.pp
index 573ed43..aa78141 100644
--- a/modules/nagios_common/manifests/contacts.pp
+++ b/modules/nagios_common/manifests/contacts.pp
@@ -10,12 +10,6 @@
 #   The base directory to put configuration directory in.
 #   Defaults to '/etc/icinga/'
 #
-# [*source*]
-#   Optional - allows to input a prewritten file as a source.
-# [*template*]
-#   puppet URL specifying the template of the contacts.cfg file
-#   Defaults to 'nagios_common/contacts.cfg.erb'
-#
 # [*owner*]
 #   The user which should own the check config files.
 #   Defaults to 'icinga'
@@ -27,11 +21,18 @@
 # [*contacts*]
 #   The list of contacts to include in the configuration.
 #
+# [*source*]
+#   Allows to input a prewritten file as a source.  Overrides "content" if
+#   defined, but "content" is used if this is undefined.
+# [*content*]
+#   Allows to input the data as a content string.  The default is
+#   template('nagios_common/contacts.cfg.erb')
+#
 class nagios_common::contacts(
 $ensure = present,
 $config_dir = '/etc/icinga',
 $source = undef,
-$template = 'nagios_common/contacts.cfg.erb',
+$content = template('nagios_common/contacts.cfg.erb'),
 $owner = 'icinga',
 $group = 'icinga',
 $contacts = [],
@@ -47,7 +48,7 @@
 } else {
 file { "${config_dir}/contacts.cfg":
 ensure  => $ensure,
-content => template($template),
+content => $content,
 owner   => $owner,
 group   => $group,
 mode=> '0600', # Only $owner:$group can read/write

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a5e88d341230907b9082a2da809ce9cb16d2f4c
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack 

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