Last active
August 29, 2015 14:20
-
-
Save ev0rtex/f128d87b06e83ffb3a2c to your computer and use it in GitHub Desktop.
ElasticSearch via Salt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
esversions: | |
1.5.1: | |
zip: "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.1.zip" | |
tar: "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.1.tar.gz" | |
deb: "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.1.deb" | |
rpm: "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.1.noarch.rpm" | |
apt: "http://packages.elasticsearch.org/elasticsearch/1.5/debian" | |
yum: "http://packages.elasticsearch.org/elasticsearch/1.5/centos" | |
plugins: | |
elasticsearch/elasticsearch-analysis-icu: 2.5.0 | |
1.5.0: | |
zip: "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.0.zip" | |
tar: "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.0.tar.gz" | |
deb: "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.0.deb" | |
rpm: "https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.0.noarch.rpm" | |
apt: "http://packages.elasticsearch.org/elasticsearch/1.5/debian" | |
yum: "http://packages.elasticsearch.org/elasticsearch/1.5/centos" | |
plugins: | |
elasticsearch/elasticsearch-analysis-icu: 2.5.0 | |
lsversions: | |
1.4.2: | |
zip: "https://download.elastic.co/logstash/logstash/logstash-1.4.2.zip" | |
tar: "https://download.elastic.co/logstash/logstash/logstash-1.4.2.tar.gz" | |
apt: "http://packages.elasticsearch.org/logstash/1.4/debian" | |
yum: "http://packages.elasticsearch.org/logstash/1.4/centos" | |
1.4.1: | |
zip: "https://download.elastic.co/logstash/logstash/logstash-1.4.1.zip" | |
tar: "https://download.elastic.co/logstash/logstash/logstash-1.4.1.tar.gz" | |
apt: "http://packages.elasticsearch.org/logstash/1.4/debian" | |
yum: "http://packages.elasticsearch.org/logstash/1.4/centos" | |
1.4.0: | |
zip: "https://download.elastic.co/logstash/logstash/logstash-1.4.0.zip" | |
tar: "https://download.elastic.co/logstash/logstash/logstash-1.4.0.tar.gz" | |
apt: "http://packages.elasticsearch.org/logstash/1.4/debian" | |
yum: "http://packages.elasticsearch.org/logstash/1.4/centos" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include: | |
- java | |
{% set esver = pillar.get('elasticsearch:version', pillar.get('esversions', {'1.5.1': {}}).keys()[0]) %} | |
elasticsearch: | |
pkgrepo.managed: | |
- humanname: ElasticSearch Repository | |
- name: deb {{ salt['pillar.get']('esversions:' ~ esver ~ ':apt') }} stable main | |
- dist: stable | |
- file: /etc/apt/sources.list.d/elasticsearch.list | |
- keyid: D88E42B4 | |
- keyserver: pgp.mit.edu | |
- require_in: | |
- pkg: elasticsearch | |
pkg.latest: | |
- name: elasticsearch | |
- require: | |
- pkg: java | |
service.running: | |
- enable: True | |
es_conf: | |
file.managed: | |
- name: /etc/elasticsearch/elasticsearch.yml | |
- source: salt://hosts/{{ grains['id'] }}/elasticsearch/config | |
- require: | |
- file: es_conf_bak | |
- watch_in: | |
- service: elasticsearch | |
es_env: | |
file.managed: | |
- name: /etc/default/elasticsearch | |
- source: salt://hosts/{{ grains['id'] }}/elasticsearch/env | |
- template: jinja | |
- require: | |
- file: es_env_bak | |
- watch_in: | |
- service: elasticsearch | |
# | |
# Plugins | |
{% for plugin, version in salt['pillar.get']('esversions:' ~ esver ~ ':plugins', {}).items() %} | |
es_plugin_{{ plugin }}: | |
cmd.run: | |
- name: /usr/share/elasticsearch/bin/plugin -i {{ plugin }}/{{ version }} | |
- unless: /usr/share/elasticsearch/bin/plugin -l | grep '{{ plugin.split('/')[-1]|replace('elasticsearch-', '') }}' | |
- require: | |
- pkg: elasticsearch | |
- watch_in: | |
- service: elasticsearch | |
{% endfor %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java: | |
pkgrepo.managed: | |
- humanname: WebUpd8 Oracle Java | |
- name: deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main | |
- dist: trusty | |
- file: /etc/apt/sources.list.d/webupd8team.list | |
- keyid: EEA14886 | |
- keyserver: keyserver.ubuntu.com | |
- require: | |
- debconf: java | |
- require_in: | |
- pkg: java | |
debconf.set: | |
- name: oracle-java8-installer | |
- data: | |
'shared/accepted-oracle-license-v1-1': {'type': 'boolean', 'value': True} | |
pkg.installed: | |
- name: oracle-java8-installer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include: | |
- java | |
{% set lsver = pillar.get('logstash:version', pillar.get('lsversions', {'1.4.2': {}}).keys()[0]) %} | |
logstash: | |
pkgrepo.managed: | |
- humanname: Logstash Repository | |
- name: deb {{ salt['pillar.get']('lsversions:' ~ lsver ~ ':apt') }} stable main | |
- dist: stable | |
- file: /etc/apt/sources.list.d/logstash.list | |
- keyid: D88E42B4 | |
- keyserver: pgp.mit.edu | |
- require_in: | |
- pkg: logstash | |
pkg.latest: | |
- name: logstash | |
- require: | |
- pkg: java | |
service.running: | |
- enable: True | |
logstash_conf: | |
file.recurse: | |
- name: /etc/logstash/conf.d | |
- source: salt://hosts/{{ grains['id'] }}/logstash/config | |
- clean: True | |
- watch_in: | |
- service: logstash |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment