Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Elasticsearch 2+ #81

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions manala.apt/CHANGELOG.md
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
### Added
- Backports sloppy support
- Elasticsearch 5 support

### Fixed
- Elasticsearch repositories patterns source urls
- Elasticsearch keys patterns urls

## [1.0.5] - 2017-10-09
### Added
Expand Down
13 changes: 8 additions & 5 deletions manala.apt/vars/main.yml
Expand Up @@ -185,16 +185,19 @@ manala_apt_repositories_patterns:
source: deb https://packagecloud.io/grafana/stable/debian/ wheezy main
key: packagecloud
elasticsearch_1_5:
source: deb http://packages.elastic.co/elasticsearch/1.5/debian stable main
source: deb https://packages.elastic.co/elasticsearch/1.5/debian stable main
key: elasticsearch
elasticsearch_1_6:
source: deb http://packages.elastic.co/elasticsearch/1.6/debian stable main
source: deb https://packages.elastic.co/elasticsearch/1.6/debian stable main
key: elasticsearch
elasticsearch_1_7:
source: deb http://packages.elastic.co/elasticsearch/1.7/debian stable main
source: deb https://packages.elastic.co/elasticsearch/1.7/debian stable main
key: elasticsearch
elasticsearch_2:
source: deb http://packages.elastic.co/elasticsearch/2.x/debian stable main
source: deb https://packages.elastic.co/elasticsearch/2.x/debian stable main
key: elasticsearch
elasticsearch_5:
source: deb https://artifacts.elastic.co/packages/5.x/apt stable main
key: elasticsearch
ansible: "{{
{
Expand Down Expand Up @@ -311,7 +314,7 @@ manala_apt_keys_patterns:
url: https://packagecloud.io/gpg.key
id: D59097AB
elasticsearch:
url: https://packages.elastic.co/GPG-KEY-elasticsearch
url: https://artifacts.elastic.co/GPG-KEY-elasticsearch
id: D88E42B4
gitlab:
url: https://packages.gitlab.com/gpg.key
Expand Down
6 changes: 6 additions & 0 deletions manala.elasticsearch/CHANGELOG.md
Expand Up @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Added
- Handle version (autodetect or fixed)
- Version based configurations
- Version based / distribution release requirements
- Version based tests
- Support version 5

## [1.0.0] - 2017-06-21
### Added
Expand Down
3 changes: 2 additions & 1 deletion manala.elasticsearch/defaults/main.yml
@@ -1,6 +1,7 @@
---

manala_elasticsearch_dir: /usr/share/elasticsearch
# Elasticsearch version. Available values are '~' (autodetect), '1.5', '1.6', '1.7', '2', '5'
manala_elasticsearch_version: ~

# Config
manala_elasticsearch_config_file: /etc/elasticsearch/elasticsearch.yml
Expand Down
18 changes: 18 additions & 0 deletions manala.elasticsearch/tasks/install.yml
Expand Up @@ -9,3 +9,21 @@
cache_valid_time: 3600
with_items:
- elasticsearch

- name: install > Version
shell: "dpkg -s elasticsearch | grep \"Version: \" | sed -e 's/Version: //g'"
register: __manala_elasticsearch_version
when: not manala_elasticsearch_version
check_mode: false
changed_when: false

- name: install > Version
set_fact:
manala_elasticsearch_version: "{{
__manala_elasticsearch_version.stdout.split('.')[0] ~ '.' ~ __manala_elasticsearch_version.stdout.split('.')[1]
if (__manala_elasticsearch_version.stdout|version_compare('2.0.0', '<')) else
__manala_elasticsearch_version.stdout.split('.')[0]
}}"
when: not manala_elasticsearch_version
check_mode: false
changed_when: false
9 changes: 9 additions & 0 deletions manala.elasticsearch/tasks/requirements.yml
Expand Up @@ -11,3 +11,12 @@
fail:
msg: Need java, you can use https://github.com/manala/ansible-role-java
when: __manala_java_check_output.stdout is not defined

- name: requirements > Version
fail:
msg: Your "manala_elasticsearch_version" is not compatible with your release
when:
- manala_elasticsearch_version != None
- manala_elasticsearch_version|version_compare('5.0.0', '>=')
and ansible_distribution_release == 'wheezy'
check_mode: false