[MediaWiki-commits] [Gerrit] operations/puppet[production]: Move role::grafana::base to profile::grafana

2018-01-18 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/404308 )

Change subject: Move role::grafana::base to profile::grafana
..


Move role::grafana::base to profile::grafana

Continue the migration to profiles for grafana. While production is
partially migrated already it uses a counter pattern. We also have
non-hierized distintions between labs/production. Start by moving the
base role to a profile
Allow the parameters in the profile::grafana class to be looked up using
explicit hiera calls

Bug: T170150
Change-Id: I68df3eadc4b95848e52356ef4ad7a49735e40e07
---
R modules/profile/manifests/grafana.pp
M modules/profile/manifests/grafana/production.pp
R modules/profile/templates/apache/sites/grafana-admin.erb
R modules/profile/templates/apache/sites/grafana-readonly.erb
M modules/role/manifests/grafana/labs.pp
5 files changed, 12 insertions(+), 13 deletions(-)

Approvals:
  Giuseppe Lavagetto: Looks good to me, but someone else must approve
  Alexandros Kosiaris: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/role/manifests/grafana/base.pp 
b/modules/profile/manifests/grafana.pp
similarity index 92%
rename from modules/role/manifests/grafana/base.pp
rename to modules/profile/manifests/grafana.pp
index 4606a5e..6374a00 100644
--- a/modules/role/manifests/grafana/base.pp
+++ b/modules/profile/manifests/grafana.pp
@@ -1,15 +1,14 @@
-# == Class: role::grafana::base
+# == Class: profile::grafana
 #
 # Grafana is a dashboarding webapp for Graphite.
-# This is a base role that should not be applied by itself
 #
-class role::grafana::base(
-$readonly_domain,
-$admin_domain,
-$secret_key,
-$admin_password,
-$ldap_editor_description,
-$ldap_editor_groups,
+class profile::grafana (
+$readonly_domain=hiera('profile::grafana::readonly_domain'),
+$admin_domain=hiera('profile::grafana::admin_domain'),
+$secret_key=hiera('profile::grafana::secret_key'),
+$admin_password=hiera('profile::grafana::admin_password'),
+
$ldap_editor_description=hiera('profile::grafana::ldap_editor_description'),
+$ldap_editor_groups=hiera('profile::grafana::ldap_edit_groups'),
 ) {
 include ::apache::mod::authnz_ldap
 include ::apache::mod::headers
@@ -172,7 +171,7 @@
 #
 
 apache::site { $readonly_domain:
-content => template('role/apache/sites/grafana-readonly.erb'),
+content => template('profile/apache/sites/grafana-readonly.erb'),
 require => Class['::grafana'],
 }
 
@@ -182,7 +181,7 @@
 }
 
 apache::site { $admin_domain:
-content => template('role/apache/sites/grafana-admin.erb'),
+content => template('profile/apache/sites/grafana-admin.erb'),
 require => Class['::grafana'],
 }
 
diff --git a/modules/profile/manifests/grafana/production.pp 
b/modules/profile/manifests/grafana/production.pp
index 1386ed8..b3cc1ce 100644
--- a/modules/profile/manifests/grafana/production.pp
+++ b/modules/profile/manifests/grafana/production.pp
@@ -6,7 +6,7 @@
 class profile::grafana::production {
 include ::passwords::grafana::production
 
-class { '::role::grafana::base':
+class { '::profile::grafana':
 readonly_domain => 'grafana.wikimedia.org',
 admin_domain=> 'grafana-admin.wikimedia.org',
 secret_key  => $passwords::grafana::production::secret_key,
diff --git a/modules/role/templates/apache/sites/grafana-admin.erb 
b/modules/profile/templates/apache/sites/grafana-admin.erb
similarity index 100%
rename from modules/role/templates/apache/sites/grafana-admin.erb
rename to modules/profile/templates/apache/sites/grafana-admin.erb
diff --git a/modules/role/templates/apache/sites/grafana-readonly.erb 
b/modules/profile/templates/apache/sites/grafana-readonly.erb
similarity index 100%
rename from modules/role/templates/apache/sites/grafana-readonly.erb
rename to modules/profile/templates/apache/sites/grafana-readonly.erb
diff --git a/modules/role/manifests/grafana/labs.pp 
b/modules/role/manifests/grafana/labs.pp
index 03484e8..0545eff 100644
--- a/modules/role/manifests/grafana/labs.pp
+++ b/modules/role/manifests/grafana/labs.pp
@@ -6,7 +6,7 @@
 class role::grafana::labs {
 include ::passwords::grafana::labs
 
-class { '::role::grafana::base':
+class { '::profile::grafana':
 readonly_domain => 'grafana-labs.wikimedia.org',
 admin_domain=> 'grafana-labs-admin.wikimedia.org',
 secret_key  => $passwords::grafana::labs::secret_key,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I68df3eadc4b95848e52356ef4ad7a49735e40e07
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Move role::grafana::base to profile::grafana

2018-01-15 Thread Alexandros Kosiaris (Code Review)
Alexandros Kosiaris has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404308 )

Change subject: Move role::grafana::base to profile::grafana
..

Move role::grafana::base to profile::grafana

Continue the migration to profiles for grafana. While production is
partially migrated already it uses a counter pattern. We also have
non-hierized distintions between labs/production. Start by moving the
base role to a profile

Bug: T170150
Change-Id: I68df3eadc4b95848e52356ef4ad7a49735e40e07
---
R modules/profile/manifests/grafana.pp
M modules/profile/manifests/grafana/production.pp
M modules/role/manifests/grafana/labs.pp
3 files changed, 4 insertions(+), 5 deletions(-)


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

diff --git a/modules/role/manifests/grafana/base.pp 
b/modules/profile/manifests/grafana.pp
similarity index 97%
rename from modules/role/manifests/grafana/base.pp
rename to modules/profile/manifests/grafana.pp
index 4606a5e..b1e480e 100644
--- a/modules/role/manifests/grafana/base.pp
+++ b/modules/profile/manifests/grafana.pp
@@ -1,9 +1,8 @@
-# == Class: role::grafana::base
+# == Class: profile::grafana
 #
 # Grafana is a dashboarding webapp for Graphite.
-# This is a base role that should not be applied by itself
 #
-class role::grafana::base(
+class profile::grafana (
 $readonly_domain,
 $admin_domain,
 $secret_key,
diff --git a/modules/profile/manifests/grafana/production.pp 
b/modules/profile/manifests/grafana/production.pp
index 1386ed8..b3cc1ce 100644
--- a/modules/profile/manifests/grafana/production.pp
+++ b/modules/profile/manifests/grafana/production.pp
@@ -6,7 +6,7 @@
 class profile::grafana::production {
 include ::passwords::grafana::production
 
-class { '::role::grafana::base':
+class { '::profile::grafana':
 readonly_domain => 'grafana.wikimedia.org',
 admin_domain=> 'grafana-admin.wikimedia.org',
 secret_key  => $passwords::grafana::production::secret_key,
diff --git a/modules/role/manifests/grafana/labs.pp 
b/modules/role/manifests/grafana/labs.pp
index 03484e8..0545eff 100644
--- a/modules/role/manifests/grafana/labs.pp
+++ b/modules/role/manifests/grafana/labs.pp
@@ -6,7 +6,7 @@
 class role::grafana::labs {
 include ::passwords::grafana::labs
 
-class { '::role::grafana::base':
+class { '::profile::grafana':
 readonly_domain => 'grafana-labs.wikimedia.org',
 admin_domain=> 'grafana-labs-admin.wikimedia.org',
 secret_key  => $passwords::grafana::labs::secret_key,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I68df3eadc4b95848e52356ef4ad7a49735e40e07
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris 

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