Skip to content

Instantly share code, notes, and snippets.

require 'resque/tasks'
task "resque:setup" => :environment
1. User Signs up and pays => Gets an alert to check their email in the next 5 to 10 minutes
2. VM is created
a. name is a randomly generated one
b. imageID is the "golden image id"
c. flavor is 1 for 256/10G or 2 for 512/20G
d. VM hostname and IP is saved to a table, and associated with the user_id
E. Setup DNS for this server RANDOMNAME.cloudpokerdb.com
3. Job to loop status of server build
4. When job changes from build to active, bootstrap the server and change root password.
a. The image will have postgres/openssl installed
cat ~/.chef/knife.rb
log_level :debug
log_location STDOUT
node_name 'makerbreaker'
client_key '/home/makerbreaker/.chef/makerbreaker.pem'
cookbook_path '/home/makerbreaker/chef-repo/cookbooks'
validation_client_name 'chef-validator'
validation_key '/etc/chef/validation.pem'
chef_server_url 'http://makerservers.com:4000'
knife cookbook site install openssl
ERROR: knife encountered an unexpected error
This may be a bug in the 'cookbook site install' knife command or plugin
Please collect the output of this command with the `-VV` option before filing a bug report.
Exception: NoMethodError: undefined method `first' for "/home/user/chef-repo/cookbooks":String
done
Bootstrapping Chef on 198-101-251-39.static.cloud-ips.com
ERROR: Network Error: getaddrinfo: Name or service not known
Check your knife configuration and network settings
ERROR: encoding SQL_ASCII does not match locale en_US.UTF-8 DETAIL: The chosen LC_CTYPE setting requires encoding UTF8. )
template0 | postgres | SQL_ASCII | en_US.UTF-8 | en_US.UTF-8 |
template1 | postgres | SQL_ASCII | en_US.UTF-8 | en_US.UTF-8 |
ERROR: encoding SQL_ASCII does not match locale en_US.UTF-8 DETAIL: The chosen LC_CTYPE setting requires encoding UTF8. )
pt3 | postgres | SQL_ASCII | en_US.UTF-8 | en_US.UTF-8 |
remote1_test | postgres | SQL_ASCII | en_US.UTF-8 | en_US.UTF-8 |
Unable to create PostgreSQL database: PT3
Reason: Unable to execute query: CREATE DATABASE "PT3" WITH TEMPLATE = template0 ENCODING = 'SQL_ASCII';; Reason: Fatal Error (ERROR: encoding SQL_ASCII does not match locale en_US.UTF-8 DETAIL: The chosen LC_CTYPE setting requires encoding UTF8. )