library/roles/smartgears/smartgears/tasks/smartgears-app.yml: Fix another bit of the smartgears playbook. See https://support.d4science.org/issues/11095

This commit is contained in:
Andrea Dell'Amico 2018-02-07 19:16:37 +01:00
parent 290e1c9f5e
commit dd74dd07ce
1 changed files with 15 additions and 7 deletions

View File

@ -132,8 +132,14 @@
- name: Print the smartgears version - name: Print the smartgears version
debug: debug:
msg: "The smartgears version is: {{ smartgears_real_version.stdout }}" msg: "The smartgears version is: {{ smartgears_real_version.stdout }}"
when: smartgears_real_version is defined
tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'smartgears_conf' ] tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'smartgears_conf' ]
# - name: Create a file with the
# copy: content={{ smartgears_real_version.stdout }} dest={{ smartgears_user_home }}/SMARTGEARS_VERSION owner=root group={{ smartgears_user }} mode=0444 force=yes
# when: smartgears_real_version is defined
# tags: [ 'smartgears', 'smartgears_distribution', 'smartgears_conf', 'tomcat' ]
# - name: Check if we have a smartgears version file # - name: Check if we have a smartgears version file
# stat: path={{ smartgears_user_home }}/SMARTGEARS_VERSION # stat: path={{ smartgears_user_home }}/SMARTGEARS_VERSION
# register: sm_version_file # register: sm_version_file
@ -174,16 +180,18 @@
become_user: '{{ smartgears_user }}' become_user: '{{ smartgears_user }}'
shell: /usr/local/bin/get-scopes {{ gcube_admin_token | default('') }} shell: /usr/local/bin/get-scopes {{ gcube_admin_token | default('') }}
when: gcube_admin_token is defined or ( smartgears_download | changed ) when: gcube_admin_token is defined or ( smartgears_download | changed )
# register: smartgears_remove_state
notify: Restart smartgears notify: Restart smartgears
tags: [ 'smartgears', 'smartgears_distribution', 'smartgears_conf', 'tomcat' ] tags: [ 'smartgears', 'smartgears_distribution', 'smartgears_conf', 'tomcat' ]
- name: Remove the smartgears application state if requested # Don't needed anymore. The get-scopes script takes care of everything
become: True # - name: Remove the smartgears application state if requested
become_user: '{{ smartgears_user }}' # become: True
shell: . {{ smartgears_user_home }}/.bashrc ; cd {{ smartgears_user_home }}/SmartGears/scripts ; ./clean-container-state -s old_saved_scopes.xml # become_user: '{{ smartgears_user }}'
when: smartgears_remove_state and not smartgears_upgrade # shell: . {{ smartgears_user_home }}/.bashrc ; cd {{ smartgears_user_home }}/SmartGears/scripts ; ./clean-container-state -s old_saved_scopes.xml
notify: Restart smartgears # when: ( smartgears_remove_state | changed )
tags: [ 'smartgears', 'smartgears_distribution', 'smartgears_conf', 'tomcat' ] # notify: Restart smartgears
# tags: [ 'smartgears', 'smartgears_distribution', 'smartgears_conf', 'tomcat' ]
- name: Force a smartgears restart - name: Force a smartgears restart
service: name='tomcat-instance-{{ smartgears_http_port }}' state=restarted service: name='tomcat-instance-{{ smartgears_http_port }}' state=restarted