Skip to content

Instantly share code, notes, and snippets.

View Maniacal's full-sized avatar

Michael Glenney Maniacal

  • New Context
  • Phoenix, Arizona, US
View GitHub Profile
@Maniacal
Maniacal / gist:0bbaf47c7b612c91aff5
Created June 26, 2015 00:24
Possible bug with chef-provisioning
#-------------> 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 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
================================================================================
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>
@Maniacal
Maniacal / .kitchen.yml
Created January 27, 2015 21:47
Fail to converge with chef-client 12.0.1 and chef 12.0.3 using either chefdk 0.3.6 or 0.3.5
---
driver:
name: vagrant
synced_folders:
- ["/tmp/synced/%{instance_name}", "/tmp/synced", "create: true"]
provisioner:
name: chef_zero
require_chef_omnibus: 12.0.1
## 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
$ 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/
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}/*"
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 %>
@Maniacal
Maniacal / gist:f5599468faacba88e249
Last active August 29, 2015 14:05
iops parameter issue
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",
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] %>"
...