Skip to content

Instantly share code, notes, and snippets.

@stratalux
stratalux / joinDomain.rb
Created April 15, 2011 17:36
Join Domain with Chef
#
# Cookbook Name:: development
# Recipe:: renameComputer
#
# Copyright 2011, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
powershell "Join Active Directory Domain" do
@stratalux
stratalux / joinDomain.rb
Created April 11, 2011 18:58
Join Windows Node to Active Directory domain with Chef-Solo on Rightscale platform
#
# Cookbook Name:: development
# Recipe:: renameComputer
#
# Copyright 2011, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
powershell "Join Active Directory Domain" do
@stratalux
stratalux / renameComputer.rb
Created April 11, 2011 18:07
Rename Windows Node and Reboot with Chef-Solo on RightScale Platform
#
# Cookbook Name:: development
# Recipe:: renameComputer
#
# Copyright 2011, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
powershell "Rename Windows Computer" do
@stratalux
stratalux / setdns.rb
Created April 11, 2011 17:19
Setting DNS on Windows Host with Chef-Solo on RightScale Platform
#
# Cookbook Name:: development
# Recipe:: setDNS
#
# Copyright 2011, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
powershell "Set Host Resolvers" do
#
# Cookbook Name:: development
# Recipe:: setDNS
#
# Copyright 2011, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
powershell "Set Host Resolvers" do
@stratalux
stratalux / setDNS.rb
Created April 11, 2011 05:00
SetDNS.rb
# Cookbook Name:: development
# Recipe:: setDNS
#
# Copyright 2011, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
powershell "Set Host Resolvers" do
@stratalux
stratalux / setDNS Chef Recipe
Created April 11, 2011 04:04
SetDNS on Windows Node Recipe - Bad
#
# Cookbook Name:: development
# Recipe:: setDNS
#
# Copyright 2011, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
powershell "Set Host Resolvers" do
@stratalux
stratalux / PowerShell Error
Created April 11, 2011 04:01
Chef Powershell Error on Rightscale
********************************************************************************
*RS> Converging ****
*RS> Run list: development::setDNS
*RS> Starting at Mon Apr 11 05:00:18 +0100 2011
05:00:18: Starting Chef Solo Run
*ERROR> Chef converge failed
*ERROR> An external command returned an error during the execution of Chef:
"powershell -command "&{set-executionpolicy -executionPolicy RemoteSigned -Scope Process; import-module C:\PROGRA~1\RIGHTS~1\SandBox\RIGHT_~1\chef\lib\windows\bin\ChefNodeCmdlet.dll; &C:/Users/RIGHTS~1/AppData/Local/Temp/chef-powershell-06D9AC00-8D64-4213-A46A-611FBAFB4426/powershell_provider_source.ps1; if ($NULL -eq $LastExitCode) { $LastExitCode = 0 }; if ((0 -eq $LastExitCode) -and ($Error.Count -gt 0)) { $RS_message = 'Script exited successfully but $Error contained '+($Error.Count)+' error(s).'; Write-warning $RS_message; $LastExitCode = 1 }; exit $LastExitCode}"" returned 1, expected 0.
@stratalux
stratalux / Chef Powershell Recipe
Created April 10, 2011 15:06
Chef Powershell Recipe example
# Cookbook Name:: windows
# Recipe:: resolver
#
# Copyright 2011
#
# All rights reserved
# Set Resolver
powershell "Set Resolver" do