library/roles/smartgears: Simplify the smartgears template management. Add a conditional to handle the case where no VO is needed, see https://support.d4science.org/issues/4723.
This commit is contained in:
parent
3618084819
commit
ae8283094a
|
@ -1,41 +1,24 @@
|
|||
---
|
||||
- name: Remove the old smart executor files
|
||||
file: path={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }} state=absent
|
||||
when:
|
||||
- smart_executor_install
|
||||
- smartgears_upgrade
|
||||
tags: [ 'smartgears', 'tomcat' ]
|
||||
- block:
|
||||
|
||||
# NOTE: Install as the smartgears user so we do not mess with the permissions
|
||||
- name: Get the smart executor plugin
|
||||
get_url: url={{ smart_executor_url }} dest={{ smartgears_user_home }}/{{ smart_executor_file }}
|
||||
when: smart_executor_install
|
||||
tags: [ 'smartgears', 'smart_executor', 'tomcat' ]
|
||||
- name: Remove the old smart executor files
|
||||
file: path={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }} state=absent
|
||||
when:
|
||||
- smart_executor_install
|
||||
- smartgears_upgrade
|
||||
|
||||
- name: Create the smart executor working directory
|
||||
file: path={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }}
|
||||
when: smart_executor_install
|
||||
tags: [ 'smartgears', 'smart_executor', 'tomcat' ]
|
||||
# NOTE: Install as the smartgears user so we do not mess with the permissions
|
||||
- name: Get the smart executor plugin
|
||||
get_url: url={{ smart_executor_url }} dest={{ smartgears_user_home }}/{{ smart_executor_file }}
|
||||
when: smart_executor_install
|
||||
|
||||
- name: Unarchive the smartexecutor distribution
|
||||
become: True
|
||||
become_user: '{{ smartgears_user }}'
|
||||
unarchive: copy=no src={{ smartgears_user_home }}/{{ smart_executor_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }} creates={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib
|
||||
when: smart_executor_install
|
||||
notify: Restart smartgears
|
||||
tags: [ 'smartgears', 'smart_executor', 'tomcat' ]
|
||||
- name: Create the smart executor working directory
|
||||
file: path={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }}
|
||||
when: smart_executor_install
|
||||
|
||||
- name: Install the smartgears configuration file
|
||||
template: src=smart_executor-container.xml.j2 dest={{ smartgears_install_path }}/container.xml owner={{ item.user }} group={{ item.user }}
|
||||
with_items: '{{ tomcat_m_instances }}'
|
||||
notify: Restart smartgears
|
||||
when: smart_executor_install
|
||||
register: smartexec_containerxml_state
|
||||
tags: [ 'smartgears', 'smart_executor', 'smart_executor_conf', 'tomcat' ]
|
||||
|
||||
- name: Remove the smartgears application state if the configuration changed
|
||||
file: dest={{ smartgears_install_path }}/state state=absent
|
||||
notify: Restart smartgears
|
||||
when: ( smartexec_containerxml_state | changed )
|
||||
tags: [ 'smartgears', 'smart_executor', 'smart_executor_conf', 'tomcat' ]
|
||||
- name: Unarchive the smartexecutor distribution
|
||||
unarchive: copy=no src={{ smartgears_user_home }}/{{ smart_executor_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }} creates={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib
|
||||
when: smart_executor_install
|
||||
notify: Restart smartgears
|
||||
|
||||
tags: [ 'smartgears', 'smart_executor', 'tomcat' ]
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
<container mode='{{ smartgears_mode }}'>
|
||||
<hostname>{{ smartgears_hostname }}</hostname>
|
||||
{%if setup_nginx %}
|
||||
{%if https_port is defined %}
|
||||
<port>{{ https_port }}</port>
|
||||
{% else %}
|
||||
<port>{{ http_port }}</port>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<port>{{ item.http_port }}</port>
|
||||
{% endif %}
|
||||
<infrastructure>{{ smartgears_infrastructure_name }}</infrastructure>
|
||||
<vo>{{ smartgears_vo_name }}</vo>
|
||||
|
||||
<site>
|
||||
<country>{{ smartgears_country }}</country>
|
||||
<location>{{ smartgears_location }}</location>
|
||||
<latitude>41.9000</latitude>
|
||||
<longitude>12.5000</longitude>
|
||||
</site>
|
||||
|
||||
<property name='SmartGearsDistribution' value='{{ smartgears_distribution_version }}' />
|
||||
<property name='SmartGearsDistributionBundle' value='UnBundled' />
|
||||
<publication-frequency>60</publication-frequency>
|
||||
|
||||
{% if smart_executor_install %}
|
||||
<application mode="{{ smartgears_mode }}" context="{{ smart_executor_context }}">
|
||||
{% for context in smart_executor_contexts_list %}
|
||||
<scope>/{{ smartgears_infrastructure_name }}/{{ smartgears_vo_name }}{{ context }}</scope>
|
||||
{% endfor %}
|
||||
</application>
|
||||
{% endif %}
|
||||
|
||||
</container>
|
|
@ -21,6 +21,7 @@ smartgears_url: 'http://maven.research-infrastructures.eu/nexus/content/reposito
|
|||
smartgears_mode: online
|
||||
# Production infra and VO
|
||||
smartgears_infrastructure_name: "d4science.research-infrastructures.eu"
|
||||
smartgears_vo: True
|
||||
smartgears_vo_name: gCubeApps
|
||||
smartgears_hostname: '{{ ansible_fqdn }}'
|
||||
smartgears_country: it
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
- name: Install the smartgears configuration file
|
||||
template: src=container.xml.j2 dest={{ smartgears_install_path }}/container.xml owner={{ item.user }} group={{ item.user }}
|
||||
with_items: '{{ tomcat_m_instances }}'
|
||||
when: ( generic_worker_install is not defined ) or ( not generic_worker_install )
|
||||
register: containerxml_state
|
||||
notify: Restart smartgears
|
||||
tags: [ 'smartgears', 'smartgears_conf', 'tomcat' ]
|
||||
|
|
|
@ -11,7 +11,9 @@
|
|||
<port>{{ item.http_port }}</port>
|
||||
{% endif %}
|
||||
<infrastructure>{{ smartgears_infrastructure_name }}</infrastructure>
|
||||
{% if smartgears_vo %}
|
||||
<vo>{{ smartgears_vo_name }}</vo>
|
||||
{% endif %}
|
||||
|
||||
<site>
|
||||
<country>{{ smartgears_country }}</country>
|
||||
|
@ -23,5 +25,13 @@
|
|||
<property name='SmartGearsDistributionBundle' value='UnBundled' />
|
||||
<property name='SmartGearsDistribution' value='{{ smartgears_distribution_version }}' />
|
||||
<publication-frequency>60</publication-frequency>
|
||||
{% if smart_executor_install is defined and smart_executor_install %}
|
||||
|
||||
<application mode="{{ smartgears_mode }}" context="{{ smart_executor_context }}">
|
||||
{% for context in smart_executor_contexts_list %}
|
||||
<scope>/{{ smartgears_infrastructure_name }}/{{ smartgears_vo_name }}{{ context }}</scope>
|
||||
{% endfor %}
|
||||
</application>
|
||||
{% endif %}
|
||||
|
||||
</container>
|
||||
|
|
Loading…
Reference in New Issue