This file contains 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
file File.join(tmp_infra_dir, 'knife.rb') do | |
content lazy { | |
<<-EOH | |
node_name 'james' | |
chef_server_url '#{chef_server_url}' | |
client_key '#{tmp_infra_dir}/james.pem' | |
cookbook_path '#{Chef::Config[:cookbook_path]}' | |
trusted_certs_dir '#{Chef::Config[:trusted_certs_dir]}' | |
EOH | |
} |
This file contains 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
Import-Module ActiveDirectory | |
$ou = (Get-ADOrganizationalUnit -Filter 'New Members').DistinguishedName | |
redircmp $ou | |
redirusr $ou |
This file contains 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
# Knife Configuration File. | |
# | |
# This is a Ruby DSL to set configuration parameters for Knife's | |
# general options. The default location for this file is | |
# ~/.chef/knife.rb. If multiple Chef repositories are used, | |
# per-repository configuration files can be created. A per repository | |
# configuration file must be .chef/knife.rb in the base directory of | |
# the Chef repository. For example, | |
# | |
# ~/Development/chef-repo/.chef/knife.rb |
This file contains 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
# | |
# Cookbook Name:: chef-provisioning-azure | |
# Recipe:: default | |
# | |
# Copyright 2015, YOUR_COMPANY_NAME | |
# | |
# All rights reserved - Do Not Redistribute | |
# | |
require 'chef/provisioning/azure_driver' |
This file contains 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
$ chef-apply test.rb | |
Recipe: (chef-apply cookbook)::(chef-apply recipe) | |
* file[hello.txt] action create | |
* cannot determine group id for 'root', does the group exist on this system? | |
================================================================================ | |
Error executing action `create` on resource 'file[hello.txt]' | |
================================================================================ | |
Chef::Exceptions::GroupIDNotFound | |
--------------------------------- |
This file contains 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
$ chef -v | |
Chef Development Kit Version: 0.4.0 |
This file contains 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
*) When I opened a cookbook, it would throw a bunch of VCS errors. | |
It offered me to add VCS paths to project. | |
- I dont know what VCS is | |
- I dont know what it would do | |
*) I would expect the 'project' to automatically detect that I am opening a Chef cookbook (Given the relatively unique and predictable structure of a chef coobook) | |
_ I could not figure out how to make Rubymine see an existing cookbook as a cookbook | |
-- Eventually I found a blogpost (http://blog.jetbrains.com/ruby/2014/09/whats-mining-chef-integration/) | |
--- blog post mentioned setting the project as a cookbook via some menu. I could not find the menu | |
--- Eventually I found that I can right click on the root of the project (cookbook), select 'mark directory as' and select 'cookbook root' |
This file contains 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
2015-04-29_21:47:32.52056 transient,infinity,supervisor, | |
2015-04-29_21:47:32.52057 [tcp_listener_sup]}}}}}}}}} | |
2015-04-29_21:47:32.52057 | |
2015-04-29_21:47:32.52058 Log files (may contain more information): | |
2015-04-29_21:47:32.52058 /var/opt/opscode/rabbitmq/log/[email protected] | |
2015-04-29_21:47:32.52058 /var/opt/opscode/rabbitmq/log/[email protected] | |
2015-04-29_21:47:32.52059 | |
2015-04-29_21:47:33.61615 {"init terminating in do_boot",{rabbit,failure_during_boot,{could_not_start,rabbit,{bad_return,{{rabbit,start,[normal,[]]},{'EXIT',{rabbit,failure_during_boot,{case_clause,{error,{{shutdown,{failed_to_start_child,tcp_listener,{cannot_listen,{127,0,0,1},5672,eaddrinuse}}},{child,undefined,'rabbit_tcp_listener_sup_127.0.0.1:5672',{tcp_listener_sup,start_link,[{127,0,0,1},5672,[inet,binary,{packet,raw},{reuseaddr,true},{backlog,128},{nodelay,true},{linger,{true,0}},{exit_on_close,false}],{rabbit_networking,tcp_listener_started,[amqp]},{rabbit_networking,tcp_listener_stoppe |
This file contains 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
2015-05-06_19:42:24.92758 [error] Could not start the network driver: econnrefused | |
2015-05-06_19:42:24.92761 | |
2015-05-06_19:42:24.93009 [error] gen_server <0.1906.0> terminated with reason: econnrefused | |
2015-05-06_19:42:24.93264 [error] CRASH REPORT Process <0.1906.0> with 0 neighbours exited with reason: econnrefused in gen_server:terminate/6 line 744 | |
2015-05-06_19:42:24.93492 [error] Supervisor {<0.1904.0>,amqp_connection_sup} had child at module undefined at <0.1906.0> exit with reason econnrefused in context child_terminated | |
2015-05-06_19:42:24.93713 [error] Supervisor {<0.1904.0>,amqp_connection_sup} had child at module undefined at <0.1906.0> exit with reason reached_max_restart_intensity in context shutdown | |
2015-05-06_19:42:24.94114 [error] "Could not connect, scheduling reconnect.", error: {{error,{badmatch,{error,{auth_failure_likely,{econnrefused,{gen_server,call,[<0.1906.0>,connect,infinity]}}}}},[{bunny_util,connect,1,[{file,"src/bunny_util.erl"},{line,191}]},{gen_bunny_mon,do_connect,3,[{file,"src |
This file contains 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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'chef/knife' | |
Chef::Config.from_file(File.join(Chef::Knife.chef_config_dir, 'knife.rb')) | |
rest = Chef::REST.new(Chef::Config[:chef_server_url]) | |
Chef::Node.list.each do |node| | |
%w{read update delete grant}.each do |perm| | |
ace = rest.get("nodes/#{node[0]}/_acl")[perm] |