From ee9830ab53d7c9f56b9d987d71d6c5f3e53c375b Mon Sep 17 00:00:00 2001 From: Wolfgang Hotwagner Date: Tue, 23 Apr 2024 13:04:59 +0000 Subject: [PATCH] Make start service optional --- defaults/main.yml | 2 +- tasks/main.yml | 20 +++++++------------- tasks/test.yml | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+), 14 deletions(-) create mode 100644 tasks/test.yml diff --git a/defaults/main.yml b/defaults/main.yml index b542495..7ea9b65 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,7 +1,7 @@ --- # # Last Changes: -# Wolfgang Hotwagner updated this file on 19. April 2024 +# Wolfgang Hotwagner updated this file on 23. April 2024 # os_nodes: |- diff --git a/tasks/main.yml b/tasks/main.yml index 5a6a212..e961945 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,4 +1,8 @@ --- +# +# Last Changes: +# Wolfgang Hotwagner updated this file on 23. April 2024 +# # Disabling for Amazon Linux 2 as selinux is disabled by default. - name: Disable the selinux @@ -12,16 +16,6 @@ - name: Include dashboards installation ansible.builtin.import_tasks: dashboards.yml -- name: Make sure opensearch dashboards is started - ansible.builtin.service: - name: dashboards - state: started - enabled: true - -- name: Get all the installed dashboards plugins - ansible.builtin.command: "sudo -u {{ os_dashboards_user }} {{ os_plugin_bin_path }} list" - register: list_plugins - -- name: Show all the installed dashboards plugins - ansible.builtin.debug: - msg: "{{ list_plugins.stdout }}" +- name: Include tests + ansible.builtin.import_tasks: test.yml + when: os_test is truthy diff --git a/tasks/test.yml b/tasks/test.yml new file mode 100644 index 0000000..e660e0c --- /dev/null +++ b/tasks/test.yml @@ -0,0 +1,18 @@ +--- +# +# Last Changes: +# Wolfgang Hotwagner updated this file on 23. April 2024 +# +- name: Make sure opensearch dashboards is started + ansible.builtin.service: + name: dashboards + state: started + enabled: true + +- name: Get all the installed dashboards plugins + ansible.builtin.command: "sudo -u {{ os_dashboards_user }} {{ os_plugin_bin_path }} list" + register: list_plugins + +- name: Show all the installed dashboards plugins + ansible.builtin.debug: + msg: "{{ list_plugins.stdout }}"