From ef1b2ab06e47afd070ffbc29bc3c136ce6359983 Mon Sep 17 00:00:00 2001 From: to-bar <46519524+to-bar@users.noreply.github.com> Date: Wed, 21 Apr 2021 15:04:46 +0200 Subject: [PATCH] opendistro_for_elasticsearch: fix upgrades after lock_timeout refactor (#2236) Co-authored-by: Michal Opala --- .../tasks/install-es.yml | 14 +++++++ .../tasks/install-opendistro.yml | 25 ++++++++++++ .../tasks/main.yml | 39 +------------------ .../upgrade-elasticsearch.yml | 2 +- .../upgrade-plugins.yml | 2 +- 5 files changed, 43 insertions(+), 39 deletions(-) create mode 100644 core/src/epicli/data/common/ansible/playbooks/roles/opendistro_for_elasticsearch/tasks/install-es.yml create mode 100644 core/src/epicli/data/common/ansible/playbooks/roles/opendistro_for_elasticsearch/tasks/install-opendistro.yml diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/opendistro_for_elasticsearch/tasks/install-es.yml b/core/src/epicli/data/common/ansible/playbooks/roles/opendistro_for_elasticsearch/tasks/install-es.yml new file mode 100644 index 0000000000..4bed42d55f --- /dev/null +++ b/core/src/epicli/data/common/ansible/playbooks/roles/opendistro_for_elasticsearch/tasks/install-es.yml @@ -0,0 +1,14 @@ +--- +- name: Install elasticsearch-oss packages + package: + name: "{{ _packages[ansible_os_family] }}" + state: present + vars: + _packages: + Debian: + - elasticsearch-oss={{ versions[ansible_os_family].elasticsearch_oss }} + RedHat: + - elasticsearch-oss-{{ versions[ansible_os_family].elasticsearch_oss }} + register: install_elasticsearch_package + module_defaults: + yum: { lock_timeout: "{{ yum_lock_timeout }}" } diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/opendistro_for_elasticsearch/tasks/install-opendistro.yml b/core/src/epicli/data/common/ansible/playbooks/roles/opendistro_for_elasticsearch/tasks/install-opendistro.yml new file mode 100644 index 0000000000..d38b2ebcd3 --- /dev/null +++ b/core/src/epicli/data/common/ansible/playbooks/roles/opendistro_for_elasticsearch/tasks/install-opendistro.yml @@ -0,0 +1,25 @@ +--- +# NOTE: Keep in mind compatibility matrix for Open Distro https://opendistro.github.io/for-elasticsearch-docs/docs/install/plugins/#plugin-compatibility +- name: Install opendistro-* packages + package: + name: "{{ _packages[ansible_os_family] }}" + state: present + vars: + _packages: + Debian: + - opendistro-alerting={{ versions[ansible_os_family].opendistro }} + - opendistro-index-management={{ versions[ansible_os_family].opendistro }} + - opendistro-job-scheduler={{ versions[ansible_os_family].opendistro }} + - opendistro-performance-analyzer={{ versions[ansible_os_family].opendistro }} + - opendistro-security={{ versions[ansible_os_family].opendistro }} + - opendistro-sql={{ versions[ansible_os_family].opendistro }} + RedHat: + - opendistro-alerting-{{ versions[ansible_os_family].opendistro }} + - opendistro-index-management-{{ versions[ansible_os_family].opendistro }} + - opendistro-job-scheduler-{{ versions[ansible_os_family].opendistro }} + - opendistro-performance-analyzer-{{ versions[ansible_os_family].opendistro }} + - opendistro-security-{{ versions[ansible_os_family].opendistro }} + - opendistro-sql-{{ versions[ansible_os_family].opendistro }} + register: install_opendistro_packages + module_defaults: + yum: { lock_timeout: "{{ yum_lock_timeout }}" } diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/opendistro_for_elasticsearch/tasks/main.yml b/core/src/epicli/data/common/ansible/playbooks/roles/opendistro_for_elasticsearch/tasks/main.yml index 0e233276af..6860c69c17 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/opendistro_for_elasticsearch/tasks/main.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/opendistro_for_elasticsearch/tasks/main.yml @@ -13,44 +13,9 @@ - { limit_type: 'soft', limit_item: 'memlock', value: unlimited } - { limit_type: 'hard', limit_item: 'memlock', value: unlimited } -- name: Install elasticsearch-oss packages - package: - name: "{{ _packages[ansible_os_family] }}" - state: present - vars: - _packages: - Debian: - - elasticsearch-oss={{ versions[ansible_os_family].elasticsearch_oss }} - RedHat: - - elasticsearch-oss-{{ versions[ansible_os_family].elasticsearch_oss }} - register: install_elasticsearch_package - module_defaults: - yum: { lock_timeout: "{{ yum_lock_timeout }}" } +- include_tasks: install-es.yml -# NOTE: Keep in mind compatibility matrix for Open Distro https://opendistro.github.io/for-elasticsearch-docs/docs/install/plugins/#plugin-compatibility -- name: Install opendistro-* packages - package: - name: "{{ _packages[ansible_os_family] }}" - state: present - vars: - _packages: - Debian: - - opendistro-alerting={{ versions[ansible_os_family].opendistro }} - - opendistro-index-management={{ versions[ansible_os_family].opendistro }} - - opendistro-job-scheduler={{ versions[ansible_os_family].opendistro }} - - opendistro-performance-analyzer={{ versions[ansible_os_family].opendistro }} - - opendistro-security={{ versions[ansible_os_family].opendistro }} - - opendistro-sql={{ versions[ansible_os_family].opendistro }} - RedHat: - - opendistro-alerting-{{ versions[ansible_os_family].opendistro }} - - opendistro-index-management-{{ versions[ansible_os_family].opendistro }} - - opendistro-job-scheduler-{{ versions[ansible_os_family].opendistro }} - - opendistro-performance-analyzer-{{ versions[ansible_os_family].opendistro }} - - opendistro-security-{{ versions[ansible_os_family].opendistro }} - - opendistro-sql-{{ versions[ansible_os_family].opendistro }} - register: install_opendistro_packages - module_defaults: - yum: { lock_timeout: "{{ yum_lock_timeout }}" } +- include_tasks: install-opendistro.yml - name: Include configuration tasks include_tasks: configure-es.yml diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/upgrade/tasks/opendistro_for_elasticsearch/upgrade-elasticsearch.yml b/core/src/epicli/data/common/ansible/playbooks/roles/upgrade/tasks/opendistro_for_elasticsearch/upgrade-elasticsearch.yml index 295cd5143f..b172405d41 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/upgrade/tasks/opendistro_for_elasticsearch/upgrade-elasticsearch.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/upgrade/tasks/opendistro_for_elasticsearch/upgrade-elasticsearch.yml @@ -55,7 +55,7 @@ - name: Open Distro for Elasticsearch | Include Elasticsearch installation tasks include_role: name: opendistro_for_elasticsearch - tasks_from: install-es-{{ ansible_os_family }}.yml + tasks_from: install-es.yml - name: Open Distro for Elasticsearch | Include Elasticsearch configuration tasks include_role: diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/upgrade/tasks/opendistro_for_elasticsearch/upgrade-plugins.yml b/core/src/epicli/data/common/ansible/playbooks/roles/upgrade/tasks/opendistro_for_elasticsearch/upgrade-plugins.yml index a41da98d57..30d2e191db 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/upgrade/tasks/opendistro_for_elasticsearch/upgrade-plugins.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/upgrade/tasks/opendistro_for_elasticsearch/upgrade-plugins.yml @@ -15,4 +15,4 @@ - name: Open Distro for Elasticsearch - plugins | Upgrade opendistro-* packages include_role: name: opendistro_for_elasticsearch - tasks_from: install-opendistro-{{ ansible_os_family }}.yml + tasks_from: install-opendistro.yml