Permalink
Browse files

First working version.

  • Loading branch information...
garthk committed Apr 12, 2012
0 parents commit ec5d49cb4af197e97f766a1223a4808a8d7bbc7b
Showing with 683 additions and 0 deletions.
  1. +3 −0 .gitignore
  2. +16 −0 Makefile
  3. +9 −0 Modulefile
  4. +68 −0 README.md
  5. +14 −0 Vagrantfile
  6. +1 −0 files/.gitignore
  7. +337 −0 files/elasticsearch.yml
  8. +7 −0 files/etc-default-elasticsearch
  9. +16 −0 files/etc-init-elasticsearch.conf
  10. +44 −0 files/logging.yml
  11. +142 −0 manifests/init.pp
  12. +1 −0 tests/init.pp
  13. +1 −0 tests/modules/elasticsearch
  14. +24 −0 tests/vagrant.pp
@@ -0,0 +1,3 @@
+metadata.json
+pkg
+.vagrant
@@ -0,0 +1,16 @@
+smoke: test
+
+test:
+ find tests -name \*.pp | xargs -n 1 -t puppet apply --noop --modulepath=tests/modules
+
+vm:
+ vagrant up
+
+es_version = 0.18.7
+es_tarchive = elasticsearch-$(es_version).tar.gz
+es_source = http://cloud.github.com/downloads/elasticsearch/elasticsearch
+
+fetch: files/$(es_tarchive)
+
+files/$(es_tarchive):
+ curl -o files/$(es_tarchive) $(es_source)/$(es_tarchive)
@@ -0,0 +1,9 @@
+name 'garthk-elasticsearch'
+version '0.1.0'
+author 'garthk'
+license 'Apache License, Version 2.0'
+summary 'Puppet module for elasticsearch on Ubuntu.'
+description "Puppet module for elasticsearch on Ubuntu."
+
+## Add dependencies, if any:
+# dependency 'username/name', '>= 1.2.0'
@@ -0,0 +1,68 @@
+Puppet module for [elasticsearch] on Ubuntu.
+
+This module roughly matches the behavior of the `.deb` file shipped with
+elasticsearch version 0.19. I can't use 0.19 with the current version of
+[logstash], however, hence this module.
+
+[logstash]: https://github.com/logstash/logstash
+
+## Prerequisites
+
+* An Ubuntu system
+* Puppet 2.7
+
+## Installation
+
+ cd /etc/puppet/modules
+ git clone git://github.com/garthk/puppet-elasticsearch elasticsearch
+ cd elasticsearch
+ make fetch # for default 0.18.7 download
+
+## Usage
+
+ class { 'elasticsearch':
+ version => '0.18.7',
+ java_package => 'openjdk-6-jre-headless',
+ dbdir => '/var/lib/elasticsearch',
+ logdir => '/var/log/elasticsearch',
+ }
+
+All arguments are optional.
+
+## Configuration:
+
+The parameters to `elasticsearch` aside, you can supply your own
+`elasticsearch.yml` and `logging.yml` files by making them available via the
+Puppet file server as either:
+
+* `site-elasticsearch/${fqdn}/*.yml` or
+* `site-elasticsearch/*.yml`.
+
+If you don't supply them, the default content will be supplied by the module.
+
+## Testing:
+
+### Smoke Testing
+
+* `make test` or `make smoke` to perform a simple [smoke test]
+
+### Vagrant
+
+* Install [Vagrant]
+
+* Get the `lucid32` box (safe even if you already have it):
+
+ vagrant box add lucid32 http://files.vagrantup.com/lucid32.box
+
+* Fetch the default version of elasticsearch:
+
+ make fetch
+
+* Launch the virtual machine:
+
+ vagrant up
+
+[elasticsearch]: http://www.elasticsearch.org/
+[Vagrant]: http://vagrantup.com/
+[smoke test]: http://docs.puppetlabs.com/guides/tests_smoke.html
+[get in touch]: http://twitter.com/garthk
@@ -0,0 +1,14 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+Vagrant::Config.run do |config|
+ config.vm.box = "lucid32"
+ config.vm.host_name = "elasticsearch"
+ config.vm.network :hostonly, "192.168.31.46"
+ config.vm.share_folder "modules/elasticsearch", "/tmp/vagrant-puppet/modules/elasticsearch", ".", :create => true
+ config.vm.provision :puppet do |puppet|
+ puppet.manifests_path = "tests"
+ puppet.manifest_file = "vagrant.pp"
+ puppet.options = ["--modulepath", "/tmp/vagrant-puppet/modules"]
+ end
+end
@@ -0,0 +1 @@
+*.tar.gz
Oops, something went wrong.

0 comments on commit ec5d49c

Please sign in to comment.