This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Smart-class parameters are declared in your Puppet manifests. You will see them at the top of the manifest within (). They will be in the form of $variable = array/string/boolean/yaml/json/integer,. Arrays will be within [] with each object within either '' or "" depending on how they are to be interpreted. Strings will be within "" or '' depending on how they are to be interpreted. | |
Examples: | |
( $packages = ['package1', 'package2', 'package3'], | |
$ensure = 'running' | |
$enable = true | |
$path = "${libpath}/nagios",) | |
These are automatically imported into Foreman as Smart-Class parameters. Whatever value is set in the manifest (a value can be null) is the default value given to the parameter in Foreman. When a parameter requires a change in value (an override) you need to go to the Smart-Class parameter tab of either the class, host group or host. You will see a list of all the parameters available and which class they belong to. Simply click the override button for the parameter you wish to alter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import xmlrpclib,sys | |
import socket | |
SATELLITE_URL = "http://serverdnsname/rpc/api" | |
#User account to connect to satellite server | |
SATELLITE_LOGIN = "<user to delete account>" | |
#Password for above connection | |
SATELLITE_PASSWORD = "<password>" | |
#Accept an argument |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am discreet on github. | |
* I am discr33t (https://keybase.io/discr33t) on keybase. | |
* I have a public key ASDq3mDQWuFKD7WscGCh3kUg0K5J3EgeeHrVtT-kLJByPwo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class repos::rsyslog inherits repos { | |
yumrepo { "rsyslog-v8-stable-el${::operatingsystemmajrelease}": | |
ensure => present, | |
descr => "Adison Rsyslog v8-stable for CentOS el${::operatingsystemmajrelease}", | |
baseurl => "https://${repos::repoweb}/repos/${repos::repomonth}/rsyslog-v8-stable_el${::operatingsystemmajrelease}", | |
enabled => '1', | |
gpgcheck => '1', | |
gpgkey => "https://${repos::repoweb}/pub/RPM-GPG-KEY-Adiscon", | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class foo { | |
$stype = $::tier | |
if !defined("::foo::${stype}") { | |
fail("The server type of ${::tier} is invalid") | |
} | |
include "::foo::${stype}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class foo { | |
case $::tier { | |
'websphere': { include '::foo::websphere' } | |
'dbora': { include '::foo::dbora' } | |
'monbot': { include '::foo::monbot' } | |
'tomcat': { include '::foo::tomcat' } | |
default: { fail("blah blah blah") } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'facter' | |
Facter.add("homedir_layout") do | |
confine :osfamily => 'RedHat' | |
setcode do | |
if File.exists?("/home/local") | |
layout = 'legacy' | |
else | |
layout = 'current' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'json' | |
require 'faraday' | |
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('1.8.7') | |
fail("Ruby >= 1.8.7 is required") | |
end | |
def which(cmd) | |
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : [''] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -k -X POST -H "Accept: application/json" \ | |
-H "Accept: application/json" -H "Content-Type: application/json" \ | |
-H "Cache-Control: no-cache" -u "username:password" \ | |
-d ' | |
{ | |
"host": { | |
"name": "<instance_id>", | |
"organization_id": 4, | |
"location_id": 12, | |
"hostgroup_id": <hostgroup_id>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m = hashlib.sha512() | |
m.update("your_password") | |
print m.hexdigest() |
NewerOlder