[MediaWiki-commits] [Gerrit] operations/puppet[production]: SystemTap Puppet module and role::systemtap::devserver

2016-11-03 Thread Ema (Code Review)
Ema has submitted this change and it was merged.

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, 83 insertions(+), 0 deletions(-)

Approvals:
  Ema: Verified; Looks good to me, approved



diff --git a/modules/role/manifests/systemtap/devserver.pp 
b/modules/role/manifests/systemtap/devserver.pp
new file mode 100644
index 000..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 000..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 000..db873cd
--- /dev/null
+++ b/modules/systemtap/manifests/devserver.pp
@@ -0,0 +1,33 @@
+# 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',
+}
+}
+
+if os_version('debian jessie') {
+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 000..c52e619
--- /dev/null
+++ b/modules/systemtap/manifests/runtime.pp
@@ -0,0 +1,22 @@
+# 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',
+}
+
+if os_version('debian jessie') {
+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: merged
Gerrit-Change-Id: I24ad8d60a0ccc7616c33af4b0a323c39344a1444
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ema 
Gerrit-Reviewer: Alexandros Kosiaris 
Gerrit-Reviewer: BBlack 
Gerrit-Reviewer: Elukey 
Gerrit-Reviewer: Ema 
Gerrit-Reviewer: Faidon Liambotis 
Gerrit-Reviewer: Filippo Giunchedi 
Gerrit-Reviewer: Muehlenhoff 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: SystemTap Puppet module and role::systemtap::devserver

2016-11-01 Thread Ema (Code Review)
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 000..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 000..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 000..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 000..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 

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