Skip to content

Instantly share code, notes, and snippets.

export VPS=YOUR.IP.ADDRESS.HERE
function initialize {
rm .ssh/known_hosts
server=${1:=${VPS}}
role=$2
: ${role:=rails}
ssh-copy-id -i ~/.ssh/id_rsa root@$server
ssh root@$1 "wget http://github.com/sid137/chef-repo/raw/master/install.sh -O install.sh && /bin/bash -x install.sh ${role}"
#!/bin/bash -x
#run installer with
# wget tiny.cc/chefconfig; bash -x install.sh role
# role is a json file that describes a roles or runlist to execute.
# download files to /tmp directory
export REPO=/tmp/chef-repo
# either run role supplied as argument, or test.json as default
#preseed.cfg
#--------------------------
# Local sets language and country.
# Should be set in boot parameter, but just in case...
d-i debian-installer/locale string en_US
# Keyboard selection.
# Disable automatic (interactive) keymap detection.
~/tmp/chef/chef-repo/server-setup $ cap chef:configure_clients
* executing `chef:configure_clients'
servers: ["dhcp-223.lkb.upmc.fr"]
** scp upload solo.rb -> /tmp/solo.rb
[dhcp-223.lkb.upmc.fr] solo.rb
* scp upload complete
servers: ["dhcp-223.lkb.upmc.fr"]
** scp upload #<StringIO:0xb76f8094> -> /tmp/chef.json
[dhcp-223.lkb.upmc.fr] /tmp/chef.json
* scp upload complete