Skip to content

Commit

Permalink
Created cloud-init directory for recipes; added cloud-init recipe for…
Browse files Browse the repository at this point in the history
… Neo4j Application (http://www.neo4j.org/develop/ec2)
  • Loading branch information
hspencer77 committed Dec 6, 2012
1 parent 14d5796 commit 1a799b9
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions cloud-init/cloud-init-neo4j.config
@@ -0,0 +1,39 @@
#cloud-config
apt_update: true
apt_upgrade: true
disable_root: true
package_reboot_if_required: true
packages:
- less
- bind9utils
- dnsutils
- mlocate
cloud_config_modules:
- ssh
- [ apt-update-upgrade, always ]
- updates-check
- runcmd
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 /var/lib/neo4j" ]
- [ sh, -xc, "mount LABEL=ephemeral0 /var/lib/neo4j" ]
- [ sh, -xc, "if [ -z `ls /var/lib/neo4j/*` ]; 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 /var/lib/neo4j/ ]; then mount LABEL=ephemeral0 /var/lib/neo4j; service neo4j-service restart; 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" ]
- [ sh, -xc, "echo 'deb http://debian.neo4j.org/repo stable/' > /etc/apt/sources.list.d/neo4j.list" ]
- [ apt-get, update ]
- [ apt-get, install, -y, --force-yes, euca2ools ]
- [ apt-get, install, -y, --force-yes, neo4j ]
- [ sh, -xc, "sed --in-place 's/#org.neo4j.server.webserver.address=0.0.0.0/org.neo4j.server.webserver.address=0.0.0.0/' /etc/neo4j/neo4j-server.properties" ]
- [ sh, -xc, "service neo4j-service restart" ]
- [ 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 ]
mounts:
- [ ephemeral0, /var/lib/neo4j, auto, "defaults,noexec" ]

0 comments on commit 1a799b9

Please sign in to comment.