From 5d38237f1ff352181b30f81456ead7918223d045 Mon Sep 17 00:00:00 2001 From: Daniel Lamb Date: Tue, 31 Oct 2017 13:29:46 -0300 Subject: [PATCH] Jiggling the cable on Api-X --- roles/internal/apix/defaults/main.yml | 2 ++ roles/internal/apix/tasks/main.yml | 5 +++ roles/internal/apix/tasks/reset.yml | 46 +++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 roles/internal/apix/tasks/reset.yml diff --git a/roles/internal/apix/defaults/main.yml b/roles/internal/apix/defaults/main.yml index d4f383eb..6aff6c87 100644 --- a/roles/internal/apix/defaults/main.yml +++ b/roles/internal/apix/defaults/main.yml @@ -18,6 +18,8 @@ apix_static_token: islandora apix_loader_url: http://localhost:8081/services//apix:load +apix_root_discovery: http://localhost:8081/discovery/ + apix_karaf_etc_dir: "{{ karaf_install_symlink }}/etc" apix_config: diff --git a/roles/internal/apix/tasks/main.yml b/roles/internal/apix/tasks/main.yml index e12351fa..930cbdda 100644 --- a/roles/internal/apix/tasks/main.yml +++ b/roles/internal/apix/tasks/main.yml @@ -10,6 +10,11 @@ - apix - apix-config +- include: reset.yml + tags: + - apix + - apix-reset + - include: crayfish.yml tags: - apix diff --git a/roles/internal/apix/tasks/reset.yml b/roles/internal/apix/tasks/reset.yml new file mode 100644 index 00000000..e6f46beb --- /dev/null +++ b/roles/internal/apix/tasks/reset.yml @@ -0,0 +1,46 @@ +--- + +- uri: + url: "{{ apix_root_discovery }}" + status_code: 200,500 + headers: + Bearer: "{{ apix_static_token }}" + register: loader_service + +- service: + name: karaf + state: stopped + when: loader_service.status == 500 + +- service: + name: tomcat8 + state: stopped + when: loader_service.status == 500 + +- service: + name: activemq + state: stopped + when: loader_service.status == 500 + +- service: + name: activemq + state: started + when: loader_service.status == 500 + +- pause: + minutes: 1 + when: loader_service.status == 500 + +- service: + name: tomcat8 + state: started + when: loader_service.status == 500 + +- pause: + minutes: 1 + when: loader_service.status == 500 + +- service: + name: karaf + state: started + when: loader_service.status == 500