Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
Added cloud-init recipe for building OpenLDAP from source on Ubuntu 1…
Browse files Browse the repository at this point in the history
…2.04 LTS
  • Loading branch information
hspencer77 committed Dec 8, 2012
1 parent 9812876 commit 314318a
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions cloud-init/cloud-init-openldap.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#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" ]

0 comments on commit 314318a

Please sign in to comment.