https://github.com/massemanet/eper/blob/master/doc/redbug.txt
Attach to the running erlang process on running EC11x or Chef 12 systems
/opt/opscode/embedded/bin/erl -name [email protected] -remsh [email protected] -setcookie erchef
https://github.com/massemanet/eper/blob/master/doc/redbug.txt
Attach to the running erlang process on running EC11x or Chef 12 systems
/opt/opscode/embedded/bin/erl -name [email protected] -remsh [email protected] -setcookie erchef
There is a long standing issue in Ruby where the net/http library by default does not check the validity of an SSL certificate during a TLS handshake. Rather than deal with the underlying problem (a missing certificate authority, a self-signed certificate, etc.) one tends to see bad hacks everywhere. This can lead to problems down the road.
From what I can see the OpenSSL library that Rails Installer delivers has no certificate authorities defined. So, let's go fetch some from the curl website. And since this is for ruby, why don't we download and install the file with a ruby script?
This is by far the most recommended way of writing resources for all users. There are two gotchas which we're working through:
action_class do ... end
block.my_property
and it works most of the time. Since it does not work all the time (because of the way ruby scopes things), its recommended to stick to referring to properties by new_resource.my_property
.You cannot subclass, and must use mixins for code-sharing (which is really a best practice anyway -- e.g. see languages like rust which do not support subclassing).
in resources/whatever.rb:
Delivery version: 0.4.109 or higher
Inspec version: 0.16.0 or higher
# Chef Bootstrap with Chef Vaults | |
# Required chef version: 12 | |
# Single Vault Item | |
$ knife bootstrap node1 -N node1 --sudo -r 'recipe[cookbook::default]' --bootstrap-vault-item 'vault:item' | |
# Multiple Vault through JSON | |
$ knife bootstrap node1 -N node1 --sudo -r 'recipe[cookbook::default]' --bootstrap-vault-json {"vault1":"item1","vault2":"item2"} | |
# Multiple Vault through File |
bash -c ' | |
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%> | |
yum install -y wget | |
wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>http://rbel.co/rbel5 | |
rpm -Uvh rbel5 | |
yum install -y rubygem-chef | |
' |
If you want to check whether a node run_list
includes a specific role (upon
expansion), then you could use role? method on the Node
object:
node.role?('name')
Alternatively, you can see whether either would work for you:
node.roles.include?('name')
node.run_list?('role[name]')
{"ssl": {"verify": false}} |
### Method 1 ### | |
$ knife role from file roles/windows_web.rb \ | |
--key .chef-test_user/test_user.pem \ | |
--user test_user | |
Benefits: | |
* Uses standard knife subcomands | |
* Out of the box | |
Caveats: | |
* Requires the users private keys on the jenkins machine. |
# 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 |