diff --git a/molecule/elasticstack_default/converge.yml b/molecule/elasticstack_default/converge.yml index dc7fd6f0..8cde64e3 100644 --- a/molecule/elasticstack_default/converge.yml +++ b/molecule/elasticstack_default/converge.yml @@ -28,16 +28,6 @@ ansible.builtin.set_fact: elasticstack_rpm_workaround: true when: ansible_os_family == 'RedHat' and ansible_distribution_major_version >= "9" - - name: Update apt cache. - ansible.builtin.apt: - update_cache: yes - cache_valid_time: 600 - changed_when: false - when: ansible_os_family == 'Debian' - - name: Install dependencies - ansible.builtin.package: - name: - - curl - name: Include Redis ansible.builtin.include_role: name: geerlingguy.redis diff --git a/molecule/elasticstack_default/molecule.yml b/molecule/elasticstack_default/molecule.yml index 9e0591c6..f92ae58b 100644 --- a/molecule/elasticstack_default/molecule.yml +++ b/molecule/elasticstack_default/molecule.yml @@ -4,7 +4,7 @@ dependency: driver: name: docker platforms: - - name: elasticstack-cluster1 + - name: "elasticstack${ELASTIC_RELEASE}-cluster1-${MOLECULE_DISTRO}" groups: - beats - logstash @@ -17,7 +17,7 @@ platforms: cgroupns_mode: host privileged: true pre_build_image: true - - name: elasticstack-cluster2 + - name: "elasticstack${ELASTIC_RELEASE}-cluster2-${MOLECULE_DISTRO}" groups: - beats - logstash diff --git a/roles/elasticsearch/tasks/elasticsearch-security.yml b/roles/elasticsearch/tasks/elasticsearch-security.yml index 2e1c695c..65483fc3 100644 --- a/roles/elasticsearch/tasks/elasticsearch-security.yml +++ b/roles/elasticsearch/tasks/elasticsearch-security.yml @@ -519,7 +519,7 @@ ansible.builtin.service: name: elasticsearch state: started - failed_when: false + enabled: yes - name: Wait for all instances to start ansible.builtin.include_tasks: wait_for_instance.yml @@ -551,15 +551,6 @@ elasticsearch_http_protocol: "https" when: elasticsearch_http_security -# Free up some space to let elsticsearch allocate replica in GitHub Action -- name: Remove cache # noqa: risky-shell-pipe - ansible.builtin.shell: > - if test -n "$(ps -p $$ | grep bash)"; then set -o pipefail; fi; - rm -rf /var/cache/* - failed_when: false - changed_when: false - when: ansible_virtualization_type == "container" - - name: Check for cluster status with bootstrap password # noqa: risky-shell-pipe ansible.builtin.shell: > if test -n "$(ps -p $$ | grep bash)"; then set -o pipefail; fi; diff --git a/roles/elasticsearch/tasks/main.yml b/roles/elasticsearch/tasks/main.yml index 174233dc..7677f040 100644 --- a/roles/elasticsearch/tasks/main.yml +++ b/roles/elasticsearch/tasks/main.yml @@ -171,6 +171,21 @@ force: yes notify: Restart Elasticsearch +# On containerized Debian 10 systemd will not recognize elasticsearch service +- name: Force systemd to reread configs on container + ansible.builtin.systemd: + daemon_reload: true + when: ansible_virtualization_type == "container" + +# Free up some space to let elsticsearch allocate replica in GitHub Action +- name: Remove cache # noqa: risky-shell-pipe + ansible.builtin.shell: > + if test -n "$(ps -p $$ | grep bash)"; then set -o pipefail; fi; + rm -rf /var/cache/* + failed_when: false + changed_when: false + when: ansible_virtualization_type == "container" + - name: Import Tasks elasticsearch-security.yml ansible.builtin.import_tasks: elasticsearch-security.yml when: @@ -186,7 +201,6 @@ name: elasticsearch state: started enabled: yes - failed_when: false - name: Handle cluster setup without security when: not elasticsearch_security | bool