Skip to content

Instantly share code, notes, and snippets.

@jpadams
jpadams / gist:5577690
Last active December 17, 2015 08:08
Puppet Dev Toolkit
###############################################
# A Puppet Devlopment Environment in 3 Flavors
###############################################
############################################
############## * VIM * ###################
############################################
# Use your favorite vim plugin tool. The rest of this gist assumes pathogen.
# https://github.com/tpope/vim-pathogen
@jpadams
jpadams / init.pp
Last active December 17, 2015 14:29
Puppet defined type to allow for installing a rpm with --noscripts option.
class az {
# This defined type is only for installing local rpm packages. Use puppet package type to remove.
# Required parameters are rpm_name (can be found by running rpm -qp <package>) & rpm_path
# I was going to wrap zypper with --download only option, but keeping it simple.
# options can be changed to whatever is sane. --noscripts at a minimum for this case.
define rpm_noscripts (
$rpm_name,
$rpm_path,
$ensure = 'installed',
@jpadams
jpadams / string_test.pp
Last active December 20, 2015 15:09
Test of what's a string in Puppet.
$tests = [
"hello",
undef,
44,
"{3 => 4}",
"world!"
]
string_test { $tests: }
$tests = [
undef, # this is NOT a hash
'foobar', # this string is NOT a hash
### these are all the same as far as puppet is concerned
#{a => b}, #
#{"a" => "b"}, #
{'a' => 'b'}, #
################
#{:a => :b}, this is not parseable
"{:a => :b}",# this is NOT a hash
Jeremys-MacBook-Pro:seteam-vagrant-stack jeremy$ vagrant plugin list
oscar (0.3.1)
vagrant-multiprovider-snap (0.0.5)
vagrant-windows (1.2.1)
Jeremys-MacBook-Pro:seteam-vagrant-stack jeremy$ vagrant up master
Bringing machine 'master' up with 'virtualbox' provider...
[master] Importing base box 'centos-64-x64-vbox4210-nocm'...
[master] Matching MAC address for NAT networking...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!--[if lt IE 7]> <html class="no-js lt-ie10 lt-ie9 lt-ie8 lt-ie7 lang-en" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie10 lt-ie9 lt-ie8 lang-en" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie10 lt-ie9 lang-en" lang="en"> <![endif]-->
<!--[if IE 9]> <html class="no-js lt-ie10 lang-en" lang="en"> <![endif]-->
<!--[if gt IE 9]><!--> <html class="no-js lang-en" lang="en"> <!--<![endif]-->
#!/opt/puppet/bin/ruby
#
# = Synopsis
#
# Collect and display facts about the system.
#
# = Usage
#
# facter [-d|--debug] [-h|--help] [-p|--puppet] [-v|--version] [-y|--yaml] [-j|--json] [--external-dir DIR] [--no-external-dir] [fact] [fact] [...]
#
@jpadams
jpadams / gist:7298944
Last active December 27, 2015 08:49
Installing Foreman on PE Agent node, CentOS 6, need dependencies repo for ruby-rgen
yum -y install http://yum.theforeman.org/releases/1.1/el6/x86_64/foreman-release.rpm
puppet resource yumrepo puppetlabs-dependencies baseurl="http://yum.puppetlabs.com/el/6/dependencies/x86_64" enabled='1' gpgcheck='1' gpgkey='http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs'
yum -y install foreman-installer
#might have to fiddle with domainname, fqdn, hostname, etc
foreman-installer
metadata :name => "windowsrun",
:description => "Run command a windows server",
:author => "Andreas Zuber <zuber@puzzle.ch>",
:license => "GPLv2",
:version => "0.1",
:url => "www.news.com",
:timeout => 60
action "run", :description => "Runs a command windows" do
display :always
module MCollective
module Agent
class Windowsrun<RPC::Agent
#test of windows run
action "run" do
name = request[:name]
month = request[:birthmonth]
day = request[:birthday]
command = "name.bat ${name} ${month} ${day}"