Skip to content

Commit

Permalink
add fail message to roles that are not available as oss version (#338)
Browse files Browse the repository at this point in the history
To prevent the a strange error message that is not easy to understand
for the basic user I added a check that fails for specific roles when
the release type and version are not available for the specific role.

---------

Co-authored-by: Thomas Widhalm <[email protected]>
  • Loading branch information
christoph2497 and widhalmt authored Oct 21, 2024
1 parent 43f99c3 commit 15ad2ea
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
7 changes: 7 additions & 0 deletions roles/elasticsearch/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---

- name: Check for versions
ansible.builtin.fail:
msg: "No OSS package with version later than 7 is available for Elasticsearch"
when:
- elasticstack_release | int > 7
- elasticstack_variant == "oss"

- name: Include global role
ansible.builtin.import_role:
name: netways.elasticstack.elasticstack
Expand Down
7 changes: 7 additions & 0 deletions roles/kibana/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
---

- name: Check for versions
ansible.builtin.fail:
msg: "No OSS package with version later than 7 is available for Kibana"
when:
- elasticstack_release | int > 7
- elasticstack_variant == "oss"

- name: Include global role
ansible.builtin.import_role:
name: netways.elasticstack.elasticstack
Expand Down
7 changes: 0 additions & 7 deletions roles/repos/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@
ansible.builtin.import_role:
name: netways.elasticstack.elasticstack

- name: Check for versions
ansible.builtin.fail:
msg: "No OSS versions later than 7 are available"
when:
- elasticstack_release | int > 7
- elasticstack_variant == "oss"

- name: Import RedHat tasks
ansible.builtin.import_tasks: redhat.yml
when: ansible_os_family == 'RedHat'
Expand Down

0 comments on commit 15ad2ea

Please sign in to comment.