Skip to content

Commit

Permalink
fix: Replace include with include_tasks (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarasg authored Sep 24, 2024
1 parent 1243587 commit 3512b22
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion tasks/elasticsearch-Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@

- name: Include optional user and group creation.
when: (es_user_id is defined) and (es_group_id is defined)
include: elasticsearch-optional-user.yml
ansible.builtin.include_tasks: elasticsearch-optional-user.yml

- name: Debian - Get installed elasticsearch version
command: dpkg-query --showformat='${Version}' --show {{ es_package_name }}
Expand Down
4 changes: 2 additions & 2 deletions tasks/elasticsearch-RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
when: es_use_repository

- name: RedHat - include versionlock
include: elasticsearch-RedHat-version-lock.yml
ansible.builtin.include_tasks: elasticsearch-RedHat-version-lock.yml

- name: RedHat - Remove the other elasticsearch package if switching between OSS and standard
become: yes
Expand All @@ -36,7 +36,7 @@

- name: Include optional user and group creation.
when: (es_user_id is defined) and (es_group_id is defined)
include: elasticsearch-optional-user.yml
ansible.builtin.include_tasks: elasticsearch-optional-user.yml

- name: RedHat - Install Elasticsearch
become: yes
Expand Down
4 changes: 2 additions & 2 deletions tasks/elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---

- name: Include specific Elasticsearch
include: elasticsearch-Debian.yml
ansible.builtin.include_tasks: elasticsearch-Debian.yml
when: ansible_os_family == 'Debian'

- name: Include specific Elasticsearch
include: elasticsearch-RedHat.yml
ansible.builtin.include_tasks: elasticsearch-RedHat.yml
when: ansible_os_family == 'RedHat'
26 changes: 13 additions & 13 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,49 +12,49 @@
- always

- name: set compatibility variables
include: compatibility-variables.yml
ansible.builtin.include_tasks: compatibility-variables.yml
tags:
- always

- name: check-set-parameters
include: elasticsearch-parameters.yml
ansible.builtin.include_tasks: elasticsearch-parameters.yml
tags:
- always

- name: use snapshot release
include: snapshot-release.yml
ansible.builtin.include_tasks: snapshot-release.yml
when: es_use_snapshot_release

- name: include java.yml
include: java.yml
ansible.builtin.include_tasks: java.yml
when: es_java_install
tags:
- java

- name: include elasticsearch.yml
include: elasticsearch.yml
ansible.builtin.include_tasks: elasticsearch.yml
tags:
- install

- name: include elasticsearch-config.yml
include: elasticsearch-config.yml
ansible.builtin.include_tasks: elasticsearch-config.yml
tags:
- config

- name: include elasticsearch-plugins.yml
include: elasticsearch-plugins.yml
ansible.builtin.include_tasks: elasticsearch-plugins.yml
when: es_plugins is defined or es_plugins_reinstall
tags:
- plugins

#We always execute xpack as we may need to remove features
- name: include xpack/elasticsearch-xpack.yml
include: xpack/elasticsearch-xpack.yml
ansible.builtin.include_tasks: xpack/elasticsearch-xpack.yml
tags:
- xpack

- name: include elasticsearch-ssl.yml
include: elasticsearch-ssl.yml
ansible.builtin.include_tasks: elasticsearch-ssl.yml
when: es_enable_http_ssl or es_enable_transport_ssl
tags:
- xpack
Expand Down Expand Up @@ -88,25 +88,25 @@
when: manage_native_realm | bool

- name: activate-license
include: ./xpack/security/elasticsearch-xpack-activation.yml
ansible.builtin.include_tasks: ./xpack/security/elasticsearch-xpack-activation.yml
when: es_start_service and not oss_version and es_xpack_license is defined and es_xpack_license != ''
run_once: True

- name: activate-trial
include: ./xpack/security/elasticsearch-xpack-trial-activation.yml
ansible.builtin.include_tasks: ./xpack/security/elasticsearch-xpack-trial-activation.yml
when: es_start_service and not oss_version and es_xpack_trial
run_once: True

#perform security actions here now elasticsearch is started
- name: include xpack/security/elasticsearch-security-native.yml
include: ./xpack/security/elasticsearch-security-native.yml
ansible.builtin.include_tasks: ./xpack/security/elasticsearch-security-native.yml
when: manage_native_realm | bool
run_once: True

#Templates done after restart - handled by flushing the handlers. e.g. suppose user removes security on a running node and doesn't specify es_api_basic_auth_username and es_api_basic_auth_password. The templates will subsequently not be removed if we don't wait for the node to restart.
#We also do after the native realm to ensure any changes are applied here first and its denf up.
- name: include elasticsearch-template.yml
include: elasticsearch-template.yml
ansible.builtin.include_tasks: elasticsearch-template.yml
when: es_templates | bool
tags:
- templates
4 changes: 2 additions & 2 deletions tasks/xpack/elasticsearch-xpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

#Security configuration
- name: include security/elasticsearch-security.yml
include: security/elasticsearch-security.yml
ansible.builtin.include_tasks: security/elasticsearch-security.yml
when: not oss_version

#Make sure elasticsearch.keystore has correct Permissions
- name: Set elasticsearch.keystore Permissions
become: yes
file:
file:
state: file
path: "{{ es_conf_dir }}/elasticsearch.keystore"
owner: root
Expand Down

0 comments on commit 3512b22

Please sign in to comment.