-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloud-config.yaml
27 lines (26 loc) · 1.15 KB
/
cloud-config.yaml
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
#cloud-config
runcmd:
# Update Apt and fetch required tools.
- apt-get -y update
- apt-get -y install git bash
- apt-get -y install build-essential
# Ditch UFW.
- ufw disable
- apt-get -y purge ufw
# Ensure environment is setup.
- export HOME=/root
# Fetch and install Chef.
- curl -L -s https://packages.chef.io/files/stable/chefdk/2.3.4/ubuntu/16.04/chefdk_2.3.4-1_amd64.deb -o /var/tmp/chefdk_2.3.4-1_amd64.deb
- dpkg -i /var/tmp/chefdk_2.3.4-1_amd64.deb
# Check-out the environment cookbook.
- git clone https://github.com/darkarnium/om-env-ogawa.git /var/tmp/provisioning
# Create the Chef zero repository.
- cd /var/tmp/provisioning/om-env-ogawa/
- berks vendor
- mkdir -p /var/tmp/chef
- mv ./berks-cookbooks /var/tmp/chef/cookbooks
- cd /var/tmp/chef/cookbooks
# Kick off chef.
- echo '{"om-env-ogawa":{"aws":{"access_key_id":"X","secret_access_key":"Y"},"app":{"conf":{"bus":{"input":{"queue":"Z","scheme":"kako"},"output":{"elasticsearch":"http://127.0.0.1:9200/kako/interaction"}}}}}}' > /var/tmp/chef/chef.json
- chmod 600 /var/tmp/chef/chef.json
- chef-client -z -o 'om-env-ogawa::default' -j /var/tmp/chef/chef.json