Skip to content

Commit

Permalink
add option to not manage repositories, usefull for corporate environm…
Browse files Browse the repository at this point in the history
…ents where you want more control over your repositories
  • Loading branch information
piotr1212 committed Feb 23, 2016
1 parent 2734e5a commit b84add3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ These variables control the behavior of the role:
* `es_release`: The release of Elasticsearch to install (default: `"1.6"`).
* `es_version`: The version of Elasticsearch to install (default: `"1.6.0"`).
* `es_wait_for_listen`: If set to true, whenever Elasticsearch is restarted, the playbook will wait for Elasticsearch to respond on port `es_etc_http_port` (default: `9200`) before proceeding (default: `"yes"`).
* `es_manage_repos`: Manage the repositories from this module (default: `true`).

### /etc/default/elasticsearch

Expand Down
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
---
# Set to "false" if you don't want to manage the package repositories from this
# role. Usefull if are behind a proxy or have a custom mirror.
es_manage_repos: true

# Elasticsearch release and version to install
es_release: "1.6"
es_minor_release: "0"
Expand Down
2 changes: 2 additions & 0 deletions tasks/debian.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
---
- name: Add ElasticSearch repo public signing key
apt_key: id=46095ACC8548582C1A2699A9D27D666CD88E42B4 url=https://packages.elastic.co/GPG-KEY-elasticsearch state=present
when: es_manage_repos

- name: Add ElasticSearch repository
apt_repository:
repo: 'deb http://packages.elasticsearch.org/elasticsearch/{{ es_release }}/debian stable main'
state: present
when: es_manage_repos

- name: Copy /etc/default/elasticsearch
template: src=elasticsearch dest=/etc/default/elasticsearch
Expand Down
2 changes: 2 additions & 0 deletions tasks/redhat.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
- name: Add ElasticSearch repo public signing key
rpm_key: key=https://packages.elastic.co/GPG-KEY-elasticsearch state=present
when: es_manage_repos

- name: Add ElasticSearch repository
template: src=elasticsearch.repo dest=/etc/yum.repos.d/elasticsearch.repo
when: es_manage_repos

- name: Copy /etc/sysconfig/elasticsearch
template: src=elasticsearch dest=/etc/sysconfig/elasticsearch
Expand Down

0 comments on commit b84add3

Please sign in to comment.