forked from orb/pophealth-chef
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ubuntu-10.04-startup.sh
40 lines (34 loc) · 1.19 KB
/
ubuntu-10.04-startup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Initially developed by Norman Richards for Ringful Health
# inspired by http://allanfeid.com/content/using-amazons-cloudformation-cloud-init-chef-and-fog-automate-infrastructure
log='/tmp/init.log'
apt-get update &>> $log
apt-get install -y ruby ruby1.8-dev build-essential wget libruby-extras libruby1.8-extras git-core &>> $log
cd /tmp
wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz &>> $log
tar zxf rubygems-1.3.7.tgz &>> $log
cd rubygems-1.3.7
ruby setup.rb --no-format-executable &>> $log
gem install ohai chef --no-rdoc --no-ri --verbose &>> $log
mkdir -p /var/chef/cache
mkdir -p /opt/pophealth-chef
git clone https://github.com/ringful/pophealth-chef.git /opt/pophealth-chef &>> $log
ln -s /opt/pophealth-chef/cookbooks /var/chef/cookbooks
ln -s /opt/pophealth-chef/roles /var/chef/roles
mkdir /etc/chef
cat <<EOF > /etc/chef/solo.rb
file_cache_path "/var/chef/cache"
cookbook_path "/var/chef/cookbooks"
role_path "/var/chef/roles"
json_attribs "/etc/chef/node.json"
log_location "/var/chef/solo.log"
verbose_logging true
EOF
cat <<EOF > /etc/chef/node.json
{
"run_list": [
"role[pophealth]"
]
}
EOF
chef-solo &>> $log