From f30ad11e654db1854d9200f0f9ddabf65476b258 Mon Sep 17 00:00:00 2001 From: Tobias Richter Date: Fri, 11 Dec 2020 10:43:09 +0100 Subject: [PATCH] Changes for Ansible 2.8 compatibility (#10) * Ensure that required variables are defined * Always wait for AEM startup to avoid issues with a already starting instance * Remove inventory hostname from task name. * Readd logging of inventory_hostname to name. Always wait for AEM to stop. * Add fail message --- tasks/main.yml | 7 +++++++ tasks/start_aem.yml | 1 - tasks/stop_aem.yml | 3 +-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index b2a146b..07590fc 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,3 +1,10 @@ +- name: Ensure that required variables are defined. + assert: + that: + - aem_service_name is defined + - aem_service_port is defined + fail_msg: "'aem_service_name' and 'aem_service_port' must be defined" + - name: Include service manager specific variables. include_vars: "{{ item }}" with_first_found: diff --git a/tasks/start_aem.yml b/tasks/start_aem.yml index 22b8d39..e0d0253 100644 --- a/tasks/start_aem.yml +++ b/tasks/start_aem.yml @@ -28,6 +28,5 @@ until: result.content.find("QUICKSTART_HOMEPAGE") != -1 retries: "{{ aem_service_timeout // 10 }}" delay: 10 - when: aem_service_start_result_escalated.changed or aem_service_start_result_restricted.changed tags: - skip_ansible_lint \ No newline at end of file diff --git a/tasks/stop_aem.yml b/tasks/stop_aem.yml index 86e6a5d..a7bc397 100644 --- a/tasks/stop_aem.yml +++ b/tasks/stop_aem.yml @@ -20,13 +20,12 @@ when: aem_service_restricted_mode -- name: Wait for AEM shutdown. +- name: "Wait for AEM shutdown. [{{ inventory_hostname }}]" wait_for: port: "{{ aem_service_port }}" state: stopped delay: 0 sleep: 10 timeout: "{{ aem_service_timeout }}" - when: aem_service_stop_result_escalated.changed or aem_service_stop_result_restricted.changed tags: - skip_ansible_lint \ No newline at end of file