-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from wcm-io-devops/feature/restricted-mode
Add restricted mode, reimplement wait for AEM service stop
- Loading branch information
Showing
7 changed files
with
117 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,32 @@ | ||
- name: Stop AEM. | ||
- name: Stop AEM (escalated). | ||
service: | ||
name: "{{ aem_service_name }}" | ||
state: stopped | ||
register: aem_service_stop_result | ||
register: aem_service_stop_result_escalated | ||
when: not aem_service_restricted_mode | ||
|
||
- name: Stop AEM (restricted). | ||
block: | ||
- name: Retrieve AEM status (restricted). | ||
raw: "{{ _aem_service_status_command }}" | ||
changed_when: false | ||
failed_when: _aem_status_result.rc not in aem_service_status_valid_status_codes | ||
register: _aem_status_result | ||
|
||
- name: Stop AEM (restricted). | ||
raw: "{{ _aem_service_stop_command }}" | ||
when: _aem_status_result.rc == 0 | ||
register: aem_service_stop_result_restricted | ||
|
||
when: aem_service_restricted_mode | ||
|
||
- name: Wait for AEM shutdown. | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
_aem_service_start_command: "{{ aem_service_start_command | default('sudo -n /etc/init.d/'+aem_service_name+' start') }}" | ||
_aem_service_stop_command: "{{ aem_service_stop_command | default('sudo -n /etc/init.d/'+aem_service_name+' stop') }}" | ||
_aem_service_status_command: "{{ aem_service_status_command | default('sudo -n /etc/init.d/'+aem_service_name+' status') }}" | ||
_aem_service_status_stopped_status_codes: "{{ aem_service_status_stopped_status_codes | default([4]) }}" | ||
_aem_service_status_started_status_codes: "{{ aem_service_status_started_status_codes | default([0]) }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
_aem_service_start_command: "{{ aem_service_start_command | default('sudo -n /bin/systemctl start '+aem_service_name ) }} && echo $?" | ||
_aem_service_stop_command: "{{ aem_service_stop_command | default('sudo -n /bin/systemctl stop '+aem_service_name ) }} && echo $?" | ||
_aem_service_status_command: "{{ aem_service_status_command | default('sudo -n /bin/systemctl is-active '+aem_service_name) }}" | ||
_aem_service_status_stopped_status_codes: "{{ aem_service_status_stopped_status_codes | default([3]) }}" | ||
_aem_service_status_started_status_codes: "{{ aem_service_status_started_status_codes | default([0]) }}" |