Elukey has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/371014 )

Change subject: role:eventubus: set deploy-service as scap deploy_user
......................................................................


role:eventubus: set deploy-service as scap deploy_user

Bug: T171506
Change-Id: I02f18ef4c506f02ec28d26bd32a0ec8c1dbf48e8
---
M modules/eventlogging/manifests/dependencies.pp
D modules/eventlogging/manifests/deployment/target.pp
M modules/role/manifests/eventbus/eventbus.pp
M modules/role/manifests/eventlogging/analytics/server.pp
4 files changed, 19 insertions(+), 66 deletions(-)

Approvals:
  Ottomata: Looks good to me, but someone else must approve
  Elukey: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/eventlogging/manifests/dependencies.pp 
b/modules/eventlogging/manifests/dependencies.pp
index 7f638eb..baf8e0d 100644
--- a/modules/eventlogging/manifests/dependencies.pp
+++ b/modules/eventlogging/manifests/dependencies.pp
@@ -3,8 +3,7 @@
 # EventLogging is a platform for modeling, logging and processing
 # arbitrary schemaed JSON data.
 #
-# This class only installs dependencies.  To set up a deployment target, use
-# the eventlogging::deployment::target define.  If you want to configure an
+# This class only installs dependencies. If you want to configure an
 # eventlogging server that will run eventlogging service daemons, include the
 # eventlogging::server class, or use one or more of the
 # eventlogging::service::* defines.
diff --git a/modules/eventlogging/manifests/deployment/target.pp 
b/modules/eventlogging/manifests/deployment/target.pp
deleted file mode 100644
index 4c9fc38..0000000
--- a/modules/eventlogging/manifests/deployment/target.pp
+++ /dev/null
@@ -1,56 +0,0 @@
-# == Define eventlogging::deployment::target
-#
-# Abstracts use of scap::target for multiple eventlogging deployment targets.
-# A corresponding 'eventlogging/$title' scap::source in the
-# scap::server::sources hiera variable must be declared.
-# See: hieradata/common/scap/server.yaml and
-#      modules/scap/manifests/deploy
-#
-# == Parameters
-#
-# [*package_name*]
-#   The name of the scap3 deployment package Default: eventlogging/$title
-#
-# [*service_name*]
-#   service_name to pass to scap::target for sudo rules.  Default: undef
-#
-# [*sudo_rules*]
-#   Array of extra sudo rules to pass to scap::target.
-#   Default: undef
-#
-# == Usage
-#
-#   # Deploy eventlogging/eventbus here, and allow
-#   # eventlogging user to restart eventlogging-service-eventbus.
-#   eventlogging::deployment::target { 'eventbus':
-#       service_name => 'eventlogging-service-eventbus',
-#   }
-#
-#   # Deploy eventlogging/eventlogging here, and allow
-#   # eventlogging user to run eventloggingctl as root.
-#   eventlogging::deployment::target { 'eventlogging':
-#       sudo_rules => ['ALL=(root) NOPASSWD: /sbin/eventloggingctl *']
-#   }
-#
-define eventlogging::deployment::target(
-    $package_name = "eventlogging/${title}",
-    $service_name = undef,
-    $sudo_rules   = undef,
-) {
-    # Install eventlogging dependencies from .deb packages.
-    include ::eventlogging::dependencies
-
-    scap::target { "eventlogging/${title}":
-        package_name => $package_name,
-        deploy_user  => 'eventlogging',
-        service_name => $service_name,
-        sudo_rules   => $sudo_rules,
-        manage_user  => false,
-    }
-
-    # Needed because scap::target doesn't manage_user.
-    ssh::userkey { 'eventlogging':
-        ensure  => 'present',
-        content => secret('keyholder/eventlogging.pub'),
-    }
-}
diff --git a/modules/role/manifests/eventbus/eventbus.pp 
b/modules/role/manifests/eventbus/eventbus.pp
index 9433b4e..452250f 100644
--- a/modules/role/manifests/eventbus/eventbus.pp
+++ b/modules/role/manifests/eventbus/eventbus.pp
@@ -21,19 +21,19 @@
     }
     $config = kafka_config('main')
 
+    include ::eventlogging::dependencies
+
     # eventlogging code for eventbus is configured to deploy
     # from the eventlogging/eventbus deploy target
     # via scap/scap.cfg on the deployment host.
-    eventlogging::deployment::target { 'eventbus':
-        service_name        => 'eventlogging-service-eventbus',
+    scap::target { 'eventlogging/eventbus':
+        deploy_user  => 'deploy-service',
+        service_name => 'eventlogging-service-eventbus',
     }
 
     # Include eventlogging server configuration, including
     # /etc/eventlogging.d directories and eventlogging user and group.
     class { 'eventlogging::server':
-        # eventlogging::deployment::target { 'eventbus':
-        # Will deploy eventlogging code to
-        # /srv/deployment/eventlogging/eventbus.
         eventlogging_path => '/srv/deployment/eventlogging/eventbus',
     }
 
diff --git a/modules/role/manifests/eventlogging/analytics/server.pp 
b/modules/role/manifests/eventlogging/analytics/server.pp
index dffe570..219f01f 100644
--- a/modules/role/manifests/eventlogging/analytics/server.pp
+++ b/modules/role/manifests/eventlogging/analytics/server.pp
@@ -6,9 +6,19 @@
         description => 'EventLogging analytics processes',
     }
 
-    # EventLogging for analytics processing is deployed
-    # as the eventlogging/analytics scap target.
-    eventlogging::deployment::target { 'analytics': }
+    include ::eventlogging::dependencies
+
+    scap::target { 'eventlogging/analytics':
+        deploy_user => 'eventlogging',
+        manage_user => false,
+    }
+
+    # Needed because scap::target doesn't manage_user.
+    ssh::userkey { 'eventlogging':
+        ensure  => 'present',
+        content => secret('keyholder/eventlogging.pub'),
+    }
+
     class { 'eventlogging::server':
         eventlogging_path => '/srv/deployment/eventlogging/analytics'
     }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I02f18ef4c506f02ec28d26bd32a0ec8c1dbf48e8
Gerrit-PatchSet: 11
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Elukey <ltosc...@wikimedia.org>
Gerrit-Reviewer: Elukey <ltosc...@wikimedia.org>
Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org>
Gerrit-Reviewer: Mobrovac <mobro...@wikimedia.org>
Gerrit-Reviewer: Ottomata <ao...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to