Skip to content

Adding support for GCE discovery #30

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tasks/gce.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# Install GCE Plugin (see https://github.com/elasticsearch/elasticsearch-cloud-gce)
#
# The following variables need to be defined in your playbook or inventory:
# - elasticsearch_plugin_gce_version
#
# The following variables provide a for now limited configuration for the plugin.
# More options may be available in the future.
# (see http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-ec2.html):

# - elasticsearch_plugin_gce_project_id
# - elasticsearch_plugin_gce_region


- name: Installing GCE Plugin
action: >
shell bin/plugin install elasticsearch/elasticsearch-cloud-gce/{{ elasticsearch_plugin_gce_version }}
chdir={{ elasticsearch_home_dir }}

# Fix permissions
- file: >
path="{{ elasticsearch_plugin_dir }}" state=directory
owner={{ elasticsearch_user }} group={{ elasticsearch_group }}
recurse=yes

4 changes: 4 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@
- include: aws.yml
when: (elasticsearch_plugin_aws_version is defined)

# Install GCE Plugin
- include: gce.yml
when: (elasticsearch_plugin_gce_version is defined)

# Install Other Generic Plugins
- include: plugins.yml
when: (elasticsearch_plugins is defined)
Expand Down
12 changes: 12 additions & 0 deletions templates/elasticsearch.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,18 @@ indices.recovery.concurrent_streams: {{ elasticsearch_recovery_concurrent_stream

################################## Discovery ##################################

{% if elasticsearch_plugin_gce_is defined %}

discovery.type: gce
{% if elasticsearch_plugin_gce_project_id defined %}
cloud.gce.project_id: '{{ elasticsearch_plugin_gce_project_id }}'
{% endif %}
{% if elasticsearch_plugin_gce_region defined %}
cloud.gce.zone: '{{ elasticsearch_plugin_gce_region }}'
{% endif %}

{% endif %}

{% if elasticsearch_plugin_aws_version is defined %}

discovery.type: ec2
Expand Down