forked from TritonDataCenter/mi-standard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustomize
executable file
·40 lines (32 loc) · 1.05 KB
/
customize
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
#!/usr/bin/bash
#
# Put customizations to your image in this file.
PATH=/opt/local/gnu/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin
# Exit if any commands fail
set -o errexit
# Ensure we have updated standard packages
echo "* Updating standard packages.";
pkg_delete -v nodejs smtools
pkg_add -v nodejs smtools
npm install smartdc -g
npm install jsontool -g
# Configuring image specific packages
echo "* Configuring image specific packages.";
# Install chef
gem install --no-ri --no-rdoc ohai
gem install --no-ri --no-rdoc chef
gem install --no-ri --no-rdoc rb-readline
mkdir /var/chef
mkdir /opt/local/etc/chef
tar xvf /root/chef.tar -C /opt/local/etc/chef
svccfg import /opt/local/etc/chef/chef-client.xml
rm /opt/local/etc/chef/chef-client.xml
# Enable PHP in Apache
echo "LoadModule php5_module lib/httpd/mod_php5.so" >> /opt/local/etc/httpd/httpd.conf
echo "AddHandler php5-script .php" >> /opt/local/etc/httpd/httpd.conf
# Clean up
echo "* Cleaning up."
rm -rf /root/*
rm -rf /.zonecontrol/metadata.sock
# Prepare image for provisioning
sm-prepare-image -y