Skip to content

Instantly share code, notes, and snippets.

View jeremymv2's full-sized avatar
🪂

Jeremy J. Miller jeremymv2

🪂
View GitHub Profile
# Logfile created on 2014-08-06 14:02:18 -0400 by logger.rb/31641
[2014-08-06T14:02:18-04:00] WARN:
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
SSL validation of HTTPS requests is disabled. HTTPS connections are still
encrypted, but chef is not able to detect forged replies or man in the middle
attacks.
To fix this issue add an entry like this to your configuration file:
```
# Logfile created on 2014-08-07 11:35:09 -0400 by logger.rb/31641
[2014-08-07T11:35:09-04:00] INFO: Pushy Client Service initialized
[2014-08-07T11:35:15-04:00] INFO: Pushy version: 1.1.1
[2014-08-07T11:35:25-04:00] INFO: STOP request from operating system.
[2014-08-07T11:35:25-04:00] INFO: Pushy is being initialized waiting for initialization to complete.
[2014-08-07T11:35:26-04:00] INFO: Pushy is being initialized waiting for initialization to complete.
[2014-08-07T11:35:29-04:00] INFO: Pushy is being initialized waiting for initialization to complete.
[2014-08-07T11:35:29-04:00] INFO: [HPSJVLWSSBX02V] Using node name: HPSJVLWSSBX02V
[2014-08-07T11:35:29-04:00] INFO: [HPSJVLWSSBX02V] Using Chef server: https://chef.hps.com/organizations/hps
[2014-08-07T11:35:29-04:00] INFO: [HPSJVLWSSBX02V] Using private key: c:/chef/client.pem
@jeremymv2
jeremymv2 / default_spec.rb
Last active February 9, 2016 19:23
spec_examples
$node = json('/tmp/node.json')
describe package('vim-minimal') do
it { should be_installed }
its('version') { should eq "#{$node['vim']['version']}" }
end
describe file('/etc/sudoers') do
its('content') { should match('admin ALL=\(ALL\) NOPASSWD:ALL') }
its('content') { should match('wheel ALL=\(ALL\) NOPASSWD:ALL') }
include_recipe 'chef-vault'
user_data_bag = chef_vault_item("passwords", node['domain-vault_id'])
username = user_data_bag["username"]
password = user_data_bag["password"]
[
"Microsoft-Windows-GroupPolicy-ServerAdmintools-Update",
"ServerManager-Core-RSAT",
"ServerManager-Core-RSAT-Role-Tools",
gem 'test-kitchen', '1.4.2'
gem 'rubocop', '= 0.36.0'
gem 'foodcritic', '= 5.0.0'
require 'rspec/core/rake_task'
require 'rubocop/rake_task'
require 'foodcritic'
require 'kitchen/cli'
# Style tests. Rubocop and Foodcritic
# TODO throwing error:
# Cannot find a resource for to_ary on ubuntu version 12.04
require 'set'
file "/root/chef_resources-#{node.name}.json" do
resource_clxn = Chef::ResourceCollection.new
run_context.resource_collection.each do |r|
next if r.class.to_s == 'Chef::Resource::NodeMetadata'
r = r.dup
Jesus
Linux1 ec2-54-227-1-21.compute-1.amazonaws.com
Linux2 ec2-54-211-238-95.compute-1.amazonaws.com
Windows ec2-52-91-171-206.compute-1.amazonaws.com

Migrating from an Existing Chef Server Install

To migrate from an existing Chef Server install requires exporting the data from your existing installation and importing it to the new installation, using tooling that ships with the Chef Server.

  1. Ensure your existing install is running the latest version of Chef Server (12.4.1).

  2. On your existing installation, create an export (as root):

1st instance: workstation-node3
2nd instance: node1
3rd instance: node2
Verify ssh conectivity to each.
sudo hostname jm-workstation-node3
Harita Pappu
ec2-107-21-16-70.compute-1.amazonaws.com workstation-node3
ec2-52-91-90-81.compute-1.amazonaws.com node1
afile = '/foo.txt'
file afile do
content 'bar'
end
if ::File.exist?(afile)
execute "myapp #{afile}"
end