Skip to content

Instantly share code, notes, and snippets.

View scarolan's full-sized avatar
🤸‍♂️
In whatever position one is in...one must find balance. -BKS Iyengar

Sean Carolan scarolan

🤸‍♂️
In whatever position one is in...one must find balance. -BKS Iyengar
View GitHub Profile
search(:users, "*:*").each do |user_data|
user user_data["id"] do
comment user_data["comment"]
password user_data["password"]
end
end
include_recipe "users::groups"
[2015-05-20T11:06:52-07:00] FATAL: Unrecognized setting enabled for audit mode.
* To enable audit mode after converge, use command line option `--audit-mode enabled` or set `:audit_mode = :enabled` in your config file.
* To disable audit mode, use command line option `--audit-mode disabled` or set `:audit_mode = :disabled` in your config file.
* To only run audit mode, use command line option `--audit-mode audit-only` or set `:audit_mode = :audit_only` in your config file.
Audit mode is disabled by default.
-----> Starting Kitchen (v1.4.0.rc.1)
-----> Converging <default-win2012r2>...
Preparing files for transfer
Preparing dna.json
Resolving cookbook dependencies with Berkshelf 3.2.3...
Removing non-cookbook files before transfer
Preparing data_bags
Preparing validation.pem
Preparing client.rb
-----> Chef Omnibus installation detected (install only if missing)
[5] pry(main)> File.exists?('C:\Windows\System32\Tasks\CSC Patching')
=> false
[6] pry(main)> File.exists?('C:\Windows\System32\Tasks\"CSC Patching')
=> false
[7] pry(main)> File.exists?('C:\Windows\System32\Tasks\"CSC Patching"')
=> false
[8] pry(main)> File.exists?("C:\\Windows\\System32\\Tasks\\CSC\ Patching")
=> false
[9] pry(main)> File.exists?("C:\\Windows\\System32\\Tasks\\CSC\ Patching")
=> false
I, [2015-06-22T17:05:19.088678 #3132] INFO -- Kitchen: -----> Starting Kitchen (v1.4.0)
I, [2015-06-22T17:05:20.375608 #3132] INFO -- Kitchen: -----> Creating <default-win2012r2>...
E, [2015-06-22T17:06:11.469878 #3132] ERROR -- Kitchen: ------Exception-------
E, [2015-06-22T17:06:11.469878 #3132] ERROR -- Kitchen: Class: Kitchen::ActionFailed
E, [2015-06-22T17:06:11.469878 #3132] ERROR -- Kitchen: Message: Failed to complete #create action:
[You are not authorized to perform this operation.]
E, [2015-06-22T17:06:11.469878 #3132] ERROR -- Kitchen: ---Nested Exception---
E, [2015-06-22T17:06:11.469878 #3132] ERROR -- Kitchen: Class: Aws::EC2::Errors::UnauthorizedOperat
ion
E, [2015-06-22T17:06:11.469878 #3132] ERROR -- Kitchen: Message: You are not authorized to perform
( •_•)
( •_•)>⌐■-■
(⌐■_■)
require 'spec_helper'
describe 'motd::default' do
let(:chef_run) { ChefSpec::SoloRunner.converge(described_recipe) }
it 'creates an motd correctly' do
expect(chef_run).to create_template('/etc/motd').with(
:user => 'root',
:group => 'root',
:mode => '0644'
)
LineLength:
Enabled: false
StringLiterals:
Enabled: false
HashSyntax:
Enabled: false
SpaceInsideParens:
Enabled: false
SpaceInsideBrackets:
Enabled: false
control_group 'SSH Security' do
control 'SSH' do
it 'should be listening on port 22' do
expect(port(22)).to be_listening
end
it 'disables root logins over ssh' do
expect(file('/etc/ssh/sshd_config')).to contain('PermitRootLogin no')
end
@scarolan
scarolan / default.rb
Created October 5, 2015 20:58
default.rb
powershell_script "Install IIS" do
action :run
code "add-windowsfeature Web-Server"
end
service "w3svc" do
action [ :enable, :start ]
end
template 'c:\inetpub\wwwroot\Default.htm' do