Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
55 lines (54 sloc) 2.81 KB
#cloud-config
apt_update: true
apt_upgrade: true
disable_root: true
cloud_config_modules:
- mounts
- ssh
- [ apt-update-upgrade, always ]
- updates-check
- runcmd
packages:
- libsasl2-modules-ldap
- libsasl2-dev
- cyrus-sasl2-dbg
- libicu-dev
- sasl2-bin
- git-core
- gcc
- libgcc1-dbg
- libdb1-compat
- linux-libc-dev
- libtool
- libltdl-dev
- libdb4.8-dev
- libssl-dev
- unixodbc-dev
- unixodbc
- syslog-ng
- less
- mlocate
- make
runcmd:
- [ sh, -xc, "if [ -b /dev/sda2 ]; then tune2fs -L ephemeral0 /dev/sda2;elif [ -b /dev/vda2 ]; then tune2fs -L ephemeral0 /dev/vda2;elif [ -b /dev/xvda2 ]; then tune2fs -L ephemeral0 /dev/xvda2;fi" ]
- [ sh, -xc, "mkdir -p /opt/openldap" ]
- [ sh, -xc, "mount LABEL=ephemeral0 /opt/openldap" ]
- [ sh, -xc, "if [ -z `ls /opt/openldap/*` ]; then sed --in-place '$ iMETA_HOSTNAME=`curl -s http://169.254.169.254/latest/meta-data/local-hostname`\\nMETA_IP=`curl -s http://169.254.169.254/latest/meta-data/local-ipv4`\\necho ${META_IP} ${META_HOSTNAME} >> /etc/hosts; hostname ${META_HOSTNAME}; sysctl -w kernel.hostname=${META_HOSTNAME}\\nif [ -d /opt/openldap/ ]; then mount LABEL=ephemeral0 /opt/openldap; fi' /etc/rc.local; fi" ]
- [ sh, -xc, "META_HOSTNAME=`curl -s http://169.254.169.254/latest/meta-data/local-hostname`; META_IP=`curl -s http://169.254.169.254/latest/meta-data/local-ipv4`; echo ${META_IP} ${META_HOSTNAME} >> /etc/hosts" ]
- [ sh, -xc, "META_HOSTNAME=`curl -s http://169.254.169.254/latest/meta-data/local-hostname`; hostname ${META_HOSTNAME}; sysctl -w kernel.hostname=${META_HOSTNAME}" ]
- [ sh, -xc, "wget -O c1240596-eucalyptus-release-key.pub http://www.eucalyptus.com/sites/all/files/c1240596-eucalyptus-release-key.pub" ]
- [ apt-key, add, c1240596-eucalyptus-release-key.pub ]
- [ sh, -xc, "echo 'deb http://downloads.eucalyptus.com/software/euca2ools/2.1/ubuntu precise main' > /etc/apt/sources.list.d/euca2ools.list" ]
- [ apt-get, update ]
- [ apt-get, install, -y, --force-yes, euca2ools ]
- [ sh, -xc, "export LANGUAGE=en_US.UTF-8" ]
- [ sh, -xc, "export LANG=en_US.UTF-8" ]
- [ sh, -xc, "export LC_ALL=en_US.UTF-8" ]
- [ locale-gen, en_US.UTF-8 ]
- [ dpkg-reconfigure, locales ]
- [ updatedb ]
- [ sh, -xc, "git clone git://git.openldap.org/openldap.git /root/openldap" ]
- [ sh, -xc, "cd /root/openldap; ./configure --prefix=/opt/openldap --enable-debug=yes --enable-syslog --enable-dynamic --enable-slapd --enable-dynacl --enable-cleartext --enable-spasswd --enable-sock --enable-monitor --enable-modules --enable-rewrite --enable-rlookups --enable-bdb --enable-dnssrv=mod --enable-hdb --enable-mdb --enable-monitor --enable-overlays --with-cyrus-sasl --with-threads --with-tls=openssl CC=gcc LDFLAGS=-L/usr/lib/sasl2" ]
- [ sh, -xc, "cd /root/openldap; make depend; make install" ]
mounts:
- [ ephemeral0, /opt/openldap, auto, "defaults,noexec" ]
You can’t perform that action at this time.