Skip to content

Instantly share code, notes, and snippets.

View greglarkin's full-sized avatar

Greg Larkin greglarkin

  • Rocklin, CA
  • 15:15 (UTC -07:00)
View GitHub Profile
@greglarkin
greglarkin / example.pp
Created October 16, 2014 15:48
Puppet file resource with array title
file { [ '/tmp/foo1', '/tmp/foo2', '/tmp/foo3' ]:
ensure => file
owner => 'root',
group => 'root',
mode => '0600',
}
class systest (
$sysctl_hash = undef,
) {
if $sysctl_hash {
validate_hash($sysctl_hash)
$sysctl_hash.each |$sysctl_name, $sysctl_attrs| {
validate_hash($sysctl_attrs)
sysctl { $sysctl_name:
class jdktest (
$versions = $jdktest::params::versions,
) inherits jdktest::params {
$package_names = prefix($versions, 'openjdk')
validate_array($versions)
validate_array($package_names)
contain jdktest::install
}
@greglarkin
greglarkin / gist:45aea0bd7cd3061e7e94
Created May 21, 2015 00:25
Example usage of the puppetlabs-puppetdb module on Centos 5.x
class { 'puppetdb':
disable_ssl => true,
manage_package_repo => true,
postgres_version => '8.4',
}
class { 'puppetdb::master::config': }
$bindir1 = '/usr/pgsql-8.4'
$bindir2 = "${bindir1}/bin"
$bindirs = [ $bindir1, $bindir2 ]
@greglarkin
greglarkin / 1st time after renaming database.ini
Created May 21, 2015 04:19
Output of puppet apply --debug
Debug: Runtime environment: ruby_version=1.8.7, run_mode=user, puppet_version=3.7.5
Debug: Loading external facts from /var/lib/puppet/facts.d
Info: Loading facts
Debug: Loading facts from /etc/puppet/modules/firewall/lib/facter/ip6tables_version.rb
Debug: Loading facts from /etc/puppet/modules/firewall/lib/facter/iptables_persistent_version.rb
Debug: Loading facts from /etc/puppet/modules/firewall/lib/facter/iptables_version.rb
Info: Loading facts
Debug: Loading facts from /etc/puppet/modules/apt/lib/facter/apt_updates.rb
Debug: Loading facts from /etc/puppet/modules/apt/lib/facter/apt_update_last_success.rb
Info: Loading facts
$hierayaml = "${settings::confdir}/hiera.yaml"
$hash = loadyaml($hierayaml)
# Displays data with hash key "yaml" present
notice($hash)
# Extract the value of key "yaml"
$yaml = $hash['yaml']
# $yaml is undef?
#!/usr/bin/ruby
#
#
# author: Eric Ohtake
#
# The custom fact fetches the Java Plugin 64 bits version currently installed on the system.
#
## Key for the version v8u65 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF2681408560F
## Key for the version v8u66 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Products\4EA42A62D9304AC4784BF2681408660F
test