Ema has uploaded a new change for review.

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

Change subject: SystemTap Puppet module and role::systemtap::devserver
......................................................................

SystemTap Puppet module and role::systemtap::devserver

The systemtap puppet module allows configuring a SystemTap development
server as well as the runtime environment required to run compiled
SystemTap probes.

A role called systemtap::devserver is also introduced by this commit.

Change-Id: I24ad8d60a0ccc7616c33af4b0a323c39344a1444
---
A modules/role/manifests/systemtap/devserver.pp
A modules/systemtap/README.md
A modules/systemtap/manifests/devserver.pp
A modules/systemtap/manifests/runtime.pp
4 files changed, 79 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/83/319083/1

diff --git a/modules/role/manifests/systemtap/devserver.pp 
b/modules/role/manifests/systemtap/devserver.pp
new file mode 100644
index 0000000..7d6f969
--- /dev/null
+++ b/modules/role/manifests/systemtap/devserver.pp
@@ -0,0 +1,11 @@
+# == Class: role::systemtap::devserver
+#
+# Role to configure a SystemTap development server
+#
+class role::systemtap::devserver {
+    include systemtap::devserver
+
+    system::role { 'role::systemtap::devserver':
+        description => 'SystemTap development environment'
+    }
+}
diff --git a/modules/systemtap/README.md b/modules/systemtap/README.md
new file mode 100644
index 0000000..cea4d79
--- /dev/null
+++ b/modules/systemtap/README.md
@@ -0,0 +1,17 @@
+# SystemTap Puppet Module #
+
+A Puppet module for configuring SystemTap development servers and the runtime
+environment required to run compiled SystemTap probes.
+
+# Usage #
+
+To configure a development environment where SystemTap probes can be compiled,
+include systemtap::devserver. The following sample probe can be executed on the
+development server to check if the basic SystemTap functionalities are working
+fine: `stap -e 'probe oneshot { println("hello world") }'`.
+
+Production machines can be configured to run SystemTap probes by including
+systemtap::runtime.
+
+# See also #
+https://wikitech.wikimedia.org/wiki/SystemTap
diff --git a/modules/systemtap/manifests/devserver.pp 
b/modules/systemtap/manifests/devserver.pp
new file mode 100644
index 0000000..e0dacda
--- /dev/null
+++ b/modules/systemtap/manifests/devserver.pp
@@ -0,0 +1,31 @@
+# Class systemtap::devserver
+# Development environment for SystemTap probes
+#
+# Actions:
+#   Installs the systemtap package, the debugging symbols for the Linux kernel
+#   and the kernel headers matching the currently running kernel.
+#
+# Usage:
+#   include systemtap::devserver
+class systemtap::devserver {
+    require_package([
+        'build-essential',
+        "linux-image-${::kernelrelease}-dbg",
+        "linux-headers-${::kernelrelease}"
+    ])
+
+    # require_package creates a dynamic intermediate class that makes declaring
+    # dependencies a bit strange. Let's use package directly here.
+    if !defined(Package['systemtap']) {
+        package { 'systemtap':
+            ensure => 'present',
+        }
+    }
+
+    apt::pin { 'systemtap':
+        package  => 'systemtap systemtap-common systemtap-runtime',
+        pin      => 'release a=jessie-backports',
+        priority => '1001',
+        before   => Package['systemtap'],
+    }
+}
diff --git a/modules/systemtap/manifests/runtime.pp 
b/modules/systemtap/manifests/runtime.pp
new file mode 100644
index 0000000..202de34
--- /dev/null
+++ b/modules/systemtap/manifests/runtime.pp
@@ -0,0 +1,20 @@
+# Class systemtap::runtime
+# SystemTap runtime environment
+#
+# Actions:
+#   Installs the systemtap-runtime package, necessary to run compiled SystemTap
+#   probes.
+#
+# Usage:
+#   include systemtap::runtime
+class systemtap::runtime {
+    package { 'systemtap-runtime':
+        ensure => 'present',
+    }
+
+    apt::pin { 'systemtap-runtime':
+        pin      => 'release a=jessie-backports',
+        priority => '1001',
+        before   => Package['systemtap-runtime'],
+    }
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I24ad8d60a0ccc7616c33af4b0a323c39344a1444
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ema <e...@wikimedia.org>

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

Reply via email to