This file contains hidden or 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
| #!/opt/puppetlabs/puppet/bin/ruby | |
| # Use the puppetclassify gem to set TTLs for puppetdb to 'forever' (0s) | |
| # to stop reports expiring. Because the class is loaded directly in the | |
| # classifier, we can't use hiera ADB to override the parameters so we have | |
| # to pump values into the NC API... | |
| # See https://github.com/puppetlabs/puppet-classify | |
| require 'puppetclassify' | |
| def initialize_puppetclassify |
This file contains hidden or 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
| #!/bin/bash | |
| # | |
| # From: https://www.redhat.com/archives/rpm-list/2006-November/msg00062.html | |
| # | |
| # Generate dummy/fake RPMs - great for acceptance testing systems | |
| # | |
| NAME=$1 | |
| # | |
| # GEnerate Provides: |
This file contains hidden or 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
| 'onceover: | |
| bundle install | |
| # puppet files | |
| find . -name '*.pp' -not -path './.onceover/*' | xargs -n1 bundle exec puppet parser validate | |
| # EPP files | |
| find . -name '*.epp' -not -path './.onceover/*' | xargs -n1 bundle exec puppet epp validate | |
| # ERB files |
This file contains hidden or 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
| $fn=5; | |
| module beam(w,h,d,j) { | |
| translate([0,0,30-1]) | |
| clip(30,30,30,3,7,false ); | |
| minkowski() { | |
| sphere(r=1); | |
| difference() { | |
| cube([w,h,d], center=true); |
This file contains hidden or 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
| $puppet_master_host="MY.PUPPET.MASTER.COM" | |
| $puppet_master_ip="6.6.6.6" | |
| $hostname = $env:computerName | |
| # fix /etc/hosts if required | |
| $puppet_master_resolved = $false | |
| try { | |
| $puppet_master_resolved = ([system.net.dns]::gethostbyName($puppet_master_host) ) | |
| } catch {} | |
| if ($puppet_master_resolved -and $puppet_master_resolved.AddressList[0].IPAddressToString -eq $puppet_master_ip ) { |
This file contains hidden or 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
| # shim.ps1 | |
| # ======== | |
| # | |
| # Run a command as another user | |
| # | |
| # RunAsUser User to become to run the command | |
| # RunAsPassword Password to become the user (SecureString is unusable since we | |
| # are fully automated and can't prompt for a password | |
| # Next command line argument - Program to run | |
| # Rest of command line arguments - Arguments will be passed to program to execute |
This file contains hidden or 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
| # Note When changing a service from a local system to a network, or | |
| # from a network to a local system, StartPassword must be an empty | |
| # string ("") and not NULL. | |
| # https://msdn.microsoft.com/en-us/library/aa384901%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396 | |
| $ps = '(gwmi win32_service -filter "name=\'puppet\'").change($null,$null,$null,$null,$null,$null,"LocalSystem","")' | |
| $st = 'if ((gwmi win32_service -filter "name=\'puppet\'").StartName -eq "LocalSystem") { exit 0 } else {exit 1}' | |
| exec { "drop_puppet_service_privs": | |
| provider => powershell, |
This file contains hidden or 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
| exec { "/bin/true": | |
| before => Exec['tada'], | |
| } | |
| exec { "tada": | |
| command => "/bin/touch /tada", | |
| } | |
| ~> exec { "next": |
This file contains hidden or 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
| # note that unset != setting to empty string! Unset will use the default value in when ruby loads, empty | |
| # string will use NO value, eg things will be broken | |
| unset RUBYLIB unset GEM_HOME | |
| unset BUNDLE_GEMFILE | |
| unset BUNDLE_BIN_PATH | |
| unset BUNDLER_VERSION | |
| unset RUBYOPT | |
| unset GEM_PATH | |
| unset GEM_HOME |
This file contains hidden or 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
| #<# | |
| #.Synopsis | |
| # Rewrite configuration files based on hiera data | |
| #.Description | |
| # .. | |
| # | |
| #.Parameter DataFile | |
| # Exported data from hiera (JSON) | |
| #.Parameter AppData | |
| # File to read configurable settings from |