Skip to content

Instantly share code, notes, and snippets.

View dgrstl's full-sized avatar

David Roberts dgrstl

View GitHub Profile
class dellpoc::dell_sccm {
exec { 'intsall_sccm':
provider => 'windows',
command => '\\\\AUSPWCFGAM1.aus.amer.dell.com\\client\\am1install.bat',
unless => 'c:\windows\system32\sc.exe query ccmexec',
}
file {'c:\windows\cmtrace.exe':
ensure => 'file',
class dellpoc::dell_sccm {
exec { 'intsall_sccm':
provider => 'windows',
command => '\\\\AUSPWCFGAM1.aus.amer.dell.com\\client\\am1install.bat',
unless => 'c:\windows\system32\sc.exe query ccmexec',
} ->
file {'c:\windows\cmtrace.exe':
ensure => 'file',
require 'json'
require 'csv'
require 'puppet/face'
# Requires installation of https://forge.puppetlabs.com/dalen/puppetdbquery
# comma separated list of fact names you care about
whitelist = File.open('whitelist.csv').read.chomp
headers = whitelist.split(',')
# get yo data
require 'json'
require 'csv'
f = File.open('foo.json')
csv_out = CSV.generate do |csv|
nodes = JSON.parse(f.read)
#create header
entry = nodes.first
csv << ['node'] + entry[1].keys
conf t
hostname n9kv
ip domain-lookup
ip domain-name localdomain
vrf context management
ip domain-name localdomain
ip name-server 10.240.0.10
interface mgmt0
vrf member management
ip address dhcp
@dgrstl
dgrstl / gist:ad7a1449cd33cc932033
Created June 9, 2015 18:35
Choco installdir problem
2. When I install notepadplusplus and If I force it to get installed on e:\notepadplusplus. Chocolatey logs shows its installed and it gets installed in c:\program files\notepad++. I don’t see any errors in the chocolatey logs.
Puppet code:
class learn03{
if $::kernel == windows{
Package { provider =>chocolatey}
@dgrstl
dgrstl / refresh_classes.sh
Created January 13, 2015 16:04
NC Refresh
!/bin/bash
# simple 3.7 NC classifier commands
declare -x PE_CERT=$(/opt/puppet/bin/puppet agent --configprint hostcert)
declare -x PE_KEY=$(/opt/puppet/bin/puppet agent --configprint hostprivkey)
declare -x PE_CA=$(/opt/puppet/bin/puppet agent --configprint localcacert)
declare -x NC_CURL_OPT="-s --cacert $PE_CA --cert $PE_CERT --key $PE_KEY --insecure"