Alexandros Kosiaris has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405000 )

Change subject: grafana: Break dependency cycle
......................................................................

grafana: Break dependency cycle

There's a dependency cycle in profile::grafana::production since it
requires profile::grafana which sets some resources grafana::dashboard
uses. Switch to include to avoid that

While at it fix minor logical error with
File[/usr/local/sbin/grafana_create_anon_user]. That file should not be
really requiring that the service is up and running because that's
irrelevant to the existence of the script itself. What's more correct is
that the dependency should be part of the Exec since that Exec requires
the service to have started so that the sqlite database exists

Change-Id: I13cd7e6709d4bdd501f23bc935b908103da7f8ad
---
M modules/profile/manifests/grafana.pp
M modules/profile/manifests/grafana/production.pp
2 files changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/00/405000/1

diff --git a/modules/profile/manifests/grafana.pp 
b/modules/profile/manifests/grafana.pp
index cf7a462..72f99ed 100644
--- a/modules/profile/manifests/grafana.pp
+++ b/modules/profile/manifests/grafana.pp
@@ -157,15 +157,15 @@
         owner   => 'root',
         group   => 'root',
         mode    => '0555',
-        require => [
-            Service['grafana-server'],
-            Package['python-sqlalchemy'],
-        ],
+        require => Package['python-sqlalchemy'],
     }
 
     exec { '/usr/local/sbin/grafana_create_anon_user --create':
         unless  => '/usr/local/sbin/grafana_create_anon_user --check',
-        require => File['/usr/local/sbin/grafana_create_anon_user'],
+        require => [
+            Service['grafana-server'],
+            File['/usr/local/sbin/grafana_create_anon_user'],
+        ]
     }
 
     # Serve Grafana via two different vhosts:
diff --git a/modules/profile/manifests/grafana/production.pp 
b/modules/profile/manifests/grafana/production.pp
index 984d88a..ec571e2 100644
--- a/modules/profile/manifests/grafana/production.pp
+++ b/modules/profile/manifests/grafana/production.pp
@@ -4,7 +4,7 @@
 # It powers <https://grafana.wikimedia.org>.
 #
 class profile::grafana::production {
-    require ::profile::grafana
+    include ::profile::grafana
 
     grafana::dashboard { 'varnish-http-errors':
         source => 'puppet:///modules/grafana/dashboards/varnish-http-errors',

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I13cd7e6709d4bdd501f23bc935b908103da7f8ad
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris <akosia...@wikimedia.org>

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

Reply via email to