Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPSEXP-1424: fix setenv.sh being wiped by subsequent roles' plays #331

Merged
merged 5 commits into from
Apr 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions molecule/default/side_effects.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
- name: Restart all services in order
import_playbook: ../../playbooks/platform-restart.yml
186 changes: 186 additions & 0 deletions playbooks/platform-restart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
---
- hosts: adw
gather_facts: no
become: true
tasks:
- name: Stop Alfresco Digital Workspace
service:
name: nginx
state: stopped
tags:
- alfresco
- stop

- hosts: nginx
gather_facts: no
become: true
tasks:
- name: Stop Reverse Proxy
service:
name: nginx
state: stopped
tags:
- infrastructure
- stop

- hosts: syncservice
gather_facts: no
become: true
tasks:
- name: Stop Alfresco Sync services
service:
name: alfresco-sync
state: stopped
tags:
- alfresco
- stop

- hosts: search
gather_facts: no
become: true
tasks:
- name: Stop Alfresco Search services
service:
name: alfresco-search
state: stopped
tags:
- alfresco
- stop

- hosts: repository
gather_facts: no
become: true
tasks:
- name: Stop Alfresco Content services
service:
name: alfresco-content{% if groups.repository | length > 1 %}-monitored-startup{% endif %}
state: stopped
tags:
- alfresco
- stop

- hosts: transformers
gather_facts: no
become: true
tasks:
- name: Stop Alfresco Transformation services
service:
name: "{{ item }}"
state: stopped
loop:
- alfresco-shared-fs
- alfresco-transform-router
- alfresco-tengine-aio
tags:
- alfresco
- stop

- hosts: database
become: true
tasks:
- name: Stop PostgreSQL
service:
name: postgresql{% if ansible_os_family != 'Debian' %}{{ dependencies_version.postgres_major_version }}{% endif %}
state: stopped
tags:
- infrastructure
- stop

- hosts: activemq
gather_facts: no
become: true
tasks:
- name: Stop ActiveMQ
service:
name: activemq
state: stopped
tags:
- infrastructure
- stop

- hosts: activemq
gather_facts: no
become: true
tasks:
- name: Start ActiveMQ
service:
name: activemq
state: started
tags:
- infrastructure
- start

- hosts: database
become: true
tasks:
- name: Start PostgreSQL
service:
name: postgresql{% if ansible_os_family != 'Debian' %}{{ dependencies_version.postgres_major_version }}{% endif %}
state: started
tags:
- infrastructure
- start

- hosts: transformers
gather_facts: no
become: true
tasks:
- name: Start Alfresco Transformation services
service:
name: "{{ item }}"
state: started
loop:
- alfresco-shared-fs
- alfresco-transform-router
- alfresco-tengine-aio
tags:
- alfresco
- start

- hosts: repository
gather_facts: no
become: true
tasks:
- name: Start Alfresco Content services
service:
name: alfresco-content{% if groups.repository | length > 1 %}-monitored-startup{% endif %}
state: started
tags:
- alfresco
- start

- hosts: search
gather_facts: no
become: true
tasks:
- name: Start Alfresco Search services
service:
name: alfresco-search
state: started
tags:
- alfresco
- start

- hosts: syncservice
gather_facts: no
become: true
tasks:
- name: Start Alfresco Sync services
service:
name: alfresco-sync
state: started
tags:
- alfresco
- start

- hosts: nginx
gather_facts: no
become: true
tasks:
- name: Start Reverse Proxy
service:
name: nginx
state: started
tags:
- infrastructure
- start
14 changes: 9 additions & 5 deletions roles/java/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@
- --xform=s|[^/]*|{{ java_home | basename }}|

- name: Add setenv bash file
template:
src: setenv.sh
dest: "{{ config_folder }}/setenv.sh"
blockinfile:
path: "{{ config_folder }}/setenv.sh"
marker: "# {mark} JAVA ENV VARS"
create: yes
block: |
#!/bin/sh
#
alxgomz marked this conversation as resolved.
Show resolved Hide resolved
export JAVA_HOME="{{ java_home }}"
export PATH="${JAVA_HOME}/bin:${PATH}"
owner: "{{ username }}"
group: "{{ group_name }}"
mode: "0755"
tags:
- molecule-idempotence-notest
2 changes: 1 addition & 1 deletion roles/tomcat/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
dest: "{{ binaries_folder }}/tomcat.sh"
group: "{{ group_name }}"
owner: "{{ username }}"
mode: "0755"
mode: "0750"
tags:
- molecule-idempotence-notest # Files is dealt with outside this role

Expand Down
2 changes: 2 additions & 0 deletions tests/molecule_it/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ if [ -n "$MOLECULE_IT_SCENARIO" ]; then
# shellcheck disable=SC2086
molecule $EXTRA_CONFIG converge -s "$MOLECULE_IT_SCENARIO" || exit 1
# shellcheck disable=SC2086
molecule $EXTRA_CONFIG side-effect -s "$MOLECULE_IT_SCENARIO"
# shellcheck disable=SC2086
molecule $EXTRA_CONFIG verify -s "$MOLECULE_IT_SCENARIO"
else
echo "$1: invalid command"
Expand Down