Skip to content

Instantly share code, notes, and snippets.

class powershell::params {
case downcase($::osfamily) {
'windows': {
case $::kernelmajversion {
'6.0': {
case $architecture {
'x64': {
}
'x86': {
#!/usr/bin/python
from nagioscheck import NagiosCheck, UsageError
from nagioscheck import PerformanceMetric, Status
import urllib2
import optparse
try:
import json
except ImportError:
import simplejson as json
This
if ( $LASTEXITCODE ) {
schtasks /create /TN "puppet upgrade task" /TR "C:\Windows\system32\WindowsPowershell\v1.0\powershell.exe -NoProfile -NonInteractive -NoLogo -ExecutionPolicy Bypass -File C:\Windows\Temp\UpgradePuppet.ps1 -version <%= @version %>" /SC Once /ST $startTime /RU SYSTEM
} else {
$today = (Get-Date -f "MM/dd/yyyy")
schtasks /change /TN "puppet upgrade task" /SD $today /ST $startTime /RU SYSTEM
}
Should change to
  • vagrant box add win2012r2x64 locationonfilesystem
  • copy other boxes to ~/.vagrant.d/boxes (on windows that is C:\Users\Name.vagrant.d)

Common issues

  • Invalid package provider chocolatey - check that you have latest - git pull
  • choco list -lo throws invalid something something - type dir c:\chocolatey\lib to verify
  • Folder missing puppet/box_modules - create the folder
  • Unknown configuration section windows something something - vagrant plugin install vagrant-windows
  • box not added errors - check ls ~/.vagrant.d/boxes Check that the naming is exact
My Repo looks like this
- puppet-modules
- dev-environment
- hiera
etc.
I want to make dev-environment a repository of its own. I don't want to use sub-modules (As they are nasty)
I need the git clone of the puppet-modules repo to bring out the dev-environment repo as well
Import-Module WebAdministration;
$ip = '0.0.0.0'
$port = 443
$sitename = ""
$certificate = ""
if((Test-Path IIS:\SslBindings\$ip!$port) -eq $true) {
$site = Get-Website | Where-Object { $_.Name -eq "$sitename" }
tests-Mac:boxen test$ ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future ./script/boxen
Boxen has a dirty tree, won't auto-update!
Some gems seem to be missing from your vendor/cache directory.
Could not find ansi-1.4.3 in any of the sources
Can't bootstrap, dependencies are outdated.
statuses = []
issues.forEach (issue) ->
statuses = (x for x in issue.status)
running this I get 7 but there are dupes in the list.
I want to get something like
Status1: 4
Status2: 1
describe 'when downloading a file using a proxy server we want to check that the erb gets evaluated correctly' do
let(:title) {'Download DotNet 4.0'}
let(:params) { { :url => 'http://myserver.com/test.exe', :destination => 'c:\temp', :proxyAddress => 'test-proxy-01:8888' } }
it { should contain_file('download-test.exe.ps1').with_content(
"$webclient = New-Object System.Net.WebClient
$proxyAddress = 'test-proxy-01:8888'
if ($proxyAddress -ne '') {
if (!$proxyAddress.StartsWith('http://')) {
$proxyAddress = 'http://' + $proxyAddress
exec { "prepare AD for exchange":
command => template('msexchange/ad_prep.ps1.erb'),
provider => powershell,
#onlyif => '' -- determin if this has already run? What if an existing exch is in the domain? What if you run it twice?
}