Skip to content

Instantly share code, notes, and snippets.

@joshcooper
joshcooper / domain_test.rb
Created May 18, 2012 16:31
Test what the domain fact would change to
require 'win32ole'
require 'win32/registry'
def connect(uri = wmi_resource_uri)
WIN32OLE.connect(uri)
end
def wmi_resource_uri( host = '.' )
"winmgmts:{impersonationLevel=impersonate}!//#{host}/root/cimv2"
end
1) Hiera::Backend#datadir should default to /var/lib/hiera
Failure/Error: Backend.datadir(:rspec, {})
Mocha::ExpectationError:
unexpected invocation: Hiera::Backend.parse_string('C:\\ProgramData/PuppetLabs/hiera/var', {})
unsatisfied expectations:
- expected exactly once, not yet invoked: Hiera::Backend.parse_string('/var/lib/hiera', {})
# ./lib/hiera/backend.rb:16:in `datadir'
# ./spec/unit/backend_spec.rb:15
2) Hiera#initialize should default to /etc/hiera.yaml for config
package { 'Java(TM) 7 Update 5':
ensure => installed,
source => '...\jre-7u5-windows-i586.exe',
install_options => [
'/s', '/v/qn" ADDLOCAL=jrecore REBOOT=Suppress JAVAUPDATE=0"'
]
}
class jenkins::registry {
include registry
# enable rdp
registry_value { 'hklm\SYSTEM\CurrentControlSet\Control\Terminal Server\fDenyTSConnections':
ensure => present,
type => dword,
data => 0,
}
}
# where <path> is the path to the MSI.
require 'win32ole'
installer = WIN32OLE.new('WindowsInstaller.Installer')
db = installer.OpenDatabase(path, 0)
puts db.SummaryInformation.Property(9)
[rails]
rails_loglevel=debug
[master]
storeconfigs=true
dbadapter=sqlite3
require 'rubygems'
require 'Win32API'
require 'win32ole'
require 'win32/registry'
require 'sys/admin'
require 'win32/process'
require 'win32/dir'
require 'win32/service'
require 'win32/api'
require 'win32/taskscheduler'
@joshcooper
joshcooper / gist:4252548
Created December 10, 2012 19:00
Settings
SETTING ':agent_catalog_run_lockfile'
lib/puppet/agent/locker.rb:32: @lockfile_path ||= Puppet[:agent_catalog_run_lockfile]
lib/puppet/defaults.rb:1052: :agent_catalog_run_lockfile => {
SETTING ':agent_disabled_lockfile'
lib/puppet/agent/disabler.rb:48: @disable_lockfile ||= Puppet::Util::JsonLockfile.new(Puppet[:agent_disabled_lockfile])
lib/puppet/defaults.rb:1058: :agent_disabled_lockfile => {
SETTING ':allow_duplicate_certs'
lib/puppet/defaults.rb:670: :allow_duplicate_certs => {
ruby -rubygems -e "require 'puppet'; puts Puppet::Type.type(:user).new(:name => 'puppet').provider"
ruby -rubygems -e "require 'puppet'; puts Puppet::Type.type(:group).new(:name => 'puppet').provider"
root@puppetmaster:/etc/puppet/modules/test/manifests# cat def.pp
define test::def {
notify { 'test':
message => "Some test def for '$name'",
}
}
root@puppetmaster:/etc/puppet/modules/test/manifests# puppet apply -e "test::def { 'puppetdsl': }"
Notice: Some test def for 'puppetdsl'
Notice: /Stage[main]//Test::Def[puppetdsl]/Notify[test]/message: defined 'message' as 'Some test def for 'puppetdsl''
Notice: Finished catalog run in 0.02 seconds