Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

sysctl merged to puppetlabs repo

  • Loading branch information...
commit 9393ba74407f42d6bc15c5bab984cca16d6c2122 1 parent 97353e1
@ripienaar authored
Showing with 0 additions and 45 deletions.
  1. +0 −20 data/sysctl/data/sysctl_data.ddl
  2. +0 −25 data/sysctl/data/sysctl_data.rb
View
20 data/sysctl/data/sysctl_data.ddl
@@ -1,20 +0,0 @@
-metadata :name => "Sysctl values",
- :description => "Retrieve values for a given sysctl",
- :author => "R.I.Pienaar <rip@devco.net>",
- :license => "ASL 2.0",
- :version => "1.0",
- :url => "http://marionette-collective.org/",
- :timeout => 1
-
-dataquery :description => "Sysctl values" do
- input :query,
- :prompt => "Variable Name",
- :description => "Valid Variable Name",
- :type => :string,
- :validation => /^[\w\-\.]+$/,
- :maxlength => 120
-
- output :value,
- :description => "Kernel Parameter Value",
- :display_as => "Value"
-end
View
25 data/sysctl/data/sysctl_data.rb
@@ -1,25 +0,0 @@
-module MCollective
- module Data
- class Sysctl_data<Base
- activate_when { File.exist?("/sbin/sysctl") }
-
- query do |sysctl|
- shell = Shell.new("/sbin/sysctl %s" % sysctl)
- shell.runcommand
-
- if shell.status.exitstatus == 0
- value = shell.stdout.chomp.split(/\s*=\s*/)[1]
-
- if value
- value = Integer(value) if value =~ /^\d+$/
- value = Float(value) if value =~ /^\d+\.\d+$/
-
- result[:value] = value
- end
- end
- end
- end
- end
-end
-
-
Please sign in to comment.
Something went wrong with that request. Please try again.