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
#-------------> This is the test recipe | |
chef_gem 'chef-provisioning-aws' do | |
version '1.2.1' | |
compile_time true if respond_to?(:compile_time) | |
end | |
require 'chef/provisioning' | |
require 'chef/provisioning/aws_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
############## This is the successful knife ssl check command: | |
ubuntu@ip-10-202-90-125:~$ sudo /opt/chef/bin/knife ssl check https://chef.example.com | |
Connecting to host chef.example.com:443 | |
Successfully verified certificates from `chef.example.com’ | |
############## This is the error: | |
[2015-06-24T00:06:18+00:00] ERROR: SSL Validation failure connecting to host: chef.example.com - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed |
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 encountered an error attempting to load the node data for "chefspec" | |
================================================================================ | |
Unexpected API Request Failure: | |
------------------------------- | |
<html><head><title>504 Gateway Timeout</title></head> | |
<body><h1>Gateway Timeout</h1> | |
<p>Server error - server 127.0.0.1 is unreachable at this moment.<br><br>Please retry the request or contact your adminstrator.<br></p> | |
</body></html> |
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
--- | |
driver: | |
name: vagrant | |
synced_folders: | |
- ["/tmp/synced/%{instance_name}", "/tmp/synced", "create: true"] | |
provisioner: | |
name: chef_zero | |
require_chef_omnibus: 12.0.1 |
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
## Here's the block_mappings snippet where I'm setting that up and the part of the script where I create the build command | |
=========================================================================================================================== | |
block_mappings='[{\"DeviceName\":\"/dev/xvdf\",\"Ebs\":{\"VolumeSize\":100,\"VolumeType\":\"gp2\",\"DeleteOnTermination\":false}},{\"DeviceName\":\"/dev/xvdg\",\"Ebs\":{\"VolumeSize\":1000,\"VolumeType\":\"gp2\",\"DeleteOnTermination\":false}}]' | |
# Create the build command | |
build_command="aws ec2 run-instances --image-id $image_id --key-name $key_name --security-group-ids $security_group_ids --instance-type $instance_type --subnet-id ${subnet_ids[$i]} --iam-instance-profile Name=${env_prefix}-wallet-server --user-data file://${env_prefix}_wallet.sh" | |
if [[ "$environment" != development ]]; then |
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
$ ls ~/.berkshelf/cookbooks/ | |
access_control-268e48575f97f44877550166d8044bfa15c68a7c/ ll_aws_linux-8ddb9180378771b8b7186fc70aabcd2a294e180f/ | |
apache2-ae50a8b010e8834ab0f2cf5b5a889870aee6aa43/ php-719317d45edd60b887f5f57f553304e0f4d641a5/ | |
bashrc-3b207fddf5593e5f3abb03b233e61a5b9f023502/ tomcat-a7cbe270ccaa963bf02913dcad38ae92975b12c3/ | |
deploy-56a5396635b41b6c78bcef43f21c68f4de3cc433/ wallet_common-4e6985b43a4c2e099b4e072767648e6ed1a7ae54/ | |
java-c5fe6c4ba13545330501341c87ebc8d15cd256f9/ | |
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
define :deploy_archive, :type => "zip" do | |
module_name = params[:name] | |
destination = params[:destination] | |
bundle_path = "#{Chef::Config[:file_cache_path]}/#{node['deployment']['id']}" | |
execute "Clean out destination" do | |
user 'root' | |
command "rm -rf #{destination}/*" |
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
In the error below, ldap_servers is an array passed to the template. Array is being defined in the cookbook attributes | |
Chef::Mixin::Template::TemplateError (Node attributes are read-only when you do not specify which precedence level to set. To set an attribute use code like `node.default["key"] = "value"') on line #14: | |
12: # Multiple entries may be specified. The address that is used | |
13: # here should be resolvable without using LDAP (obviously). | |
14: uri <% nodes = @ldap_servers.collect! { |a| "ldaps://" + a } -%><%= nodes.join(" ") %> | |
15: base <%= @ldap_base %> | |
16: tls_cacertdir <%= @certdir %> | |
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
Here are the params being passed: | |
{ "ParameterKey": "MysqlDBAllocatedStorage", "ParameterValue" : "250" }, | |
{ "ParameterKey": "MysqlDBIOPS", "ParameterValue" : 2000 }, | |
{ "ParameterKey": "MysqlDBInstanceClass", "ParameterValue" : "db.m3.xlarge" } | |
Here's the parameter declaration: | |
"MysqlDBIOPS" : { | |
"Description" : "Number of IOPS to provision; 1000 increments per 100GB allocated storage", |
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
cat > /etc/chef/client.rb <<'EOP' | |
log_level :auto | |
log_location "/var/log/chef/client.log" | |
chef_server_url "<%= @chef_config[:chef_server_url] %>" | |
validation_client_name "<%= @chef_config[:validation_client_name] %>" | |
node_name "<%= @config[:chef_node_name] %>" | |
environment "<%= @chef_config[:environment] %>" | |
http_proxy "<%= knife_config[:bootstrap_proxy] %>" | |
https_proxy "<%= knife_config[:bootstrap_proxy] %>" | |
... |