forked from ISTI-ansible-roles/ansible-roles
ibrary/roles/smartgears/resource_registry: Convert the role to maven_artifact.
This commit is contained in:
parent
4a71e76e2a
commit
a990b8f6a8
|
@ -1,13 +1,8 @@
|
||||||
---
|
---
|
||||||
resource_registry_install: False
|
resource_registry_install: False
|
||||||
resource_registry_upgrade: False
|
resource_registry_upgrade: False
|
||||||
resource_registry_gcube_repository: gcube-snapshots
|
resource_registry_version: 1.4.0-4.5.0-148947
|
||||||
resource_registry_snapshot_ver: 1.4.0-SNAPSHOT
|
|
||||||
|
|
||||||
resource_registry_name: resource-registry
|
resource_registry_name: resource-registry
|
||||||
#resource_registry_version: 1.3.0-20170203.144034-13
|
resource_registry_extension: war
|
||||||
#resource_registry_file: '{{ resource_registry_name }}-{{ resource_registry_version }}.war'
|
resource_registry_file: '{{ resource_registry_name }}-{{ resource_registry_version }}.{{ resource_registry_extension }}'
|
||||||
resource_registry_file: '{{ resource_registry_name }}-{{ resource_registry_snapshot_ver }}.war'
|
resource_registry_group_id: org.gcube.information-system
|
||||||
|
|
||||||
resource_registry_url: 'http://maven.research-infrastructures.eu/nexus/service/local/artifact/maven/redirect?r={{ resource_registry_gcube_repository }}&g=org.gcube.information-system&a={{resource_registry_name}}&v={{ resource_registry_snapshot_ver }}&e=war'
|
|
||||||
# resource_registry_url: 'http://maven.research-infrastructures.eu/nexus/content/repositories/{{ resource_registry_gcube_repository }}/org/gcube/information-system/{{resource_registry_name}}/{{ resource_registry_snapshot_ver }}/{{ resource_registry_file }}'
|
|
||||||
|
|
|
@ -1,24 +1,22 @@
|
||||||
---
|
---
|
||||||
- block:
|
- block:
|
||||||
|
|
||||||
- name: Remove the old resource-registry files
|
- name: Remove the old resource-registry files
|
||||||
file: path={{ smartgears_instance_path }}/webapps/{{ resource_registry_name }} state=absent
|
file: path={{ smartgears_instance_path }}/webapps/{{ resource_registry_name }} state=absent
|
||||||
when: resource_registry_upgrade
|
when: resource_registry_upgrade
|
||||||
|
|
||||||
# # NOTE: Install as the smartgears user so we do not mess with the permissions
|
|
||||||
# - name: Get the resource-registry-service
|
|
||||||
# get_url: url={{ resource_registry_url }} dest={{ smartgears_user_home }}/{{ resource_registry_file }}
|
|
||||||
|
|
||||||
- name: Create the resource-registry working directory
|
- name: Create the resource-registry working directory
|
||||||
file: path={{ smartgears_instance_path }}/webapps/{{ resource_registry_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }}
|
file: path={{ smartgears_instance_path }}/webapps/{{ resource_registry_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }}
|
||||||
|
|
||||||
- name: Unarchive the resource_registry war
|
- name: Get the resource_registry war
|
||||||
# unarchive: copy=no src={{ smartgears_user_home }}/{{ resource_registry_file }} dest={{ smartgears_instance_path }}/webapps/{{ resource_registry_name }} creates={{ smartgears_instance_path }}/webapps/{{ resource_registry_name }}/WEB-INF/lib
|
maven_artifact: artifact_id={{ resource_registry_name }} version={{ resource_registry_version | default('latest') }} group_id={{ resource_registry_group_id }} extension={{ resource_registry_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_user_home }}/{{ resource_registry_file }}
|
||||||
unarchive: copy=no src={{ resource_registry_url }} dest={{ smartgears_instance_path }}/webapps/{{ resource_registry_name }} creates={{ smartgears_instance_path }}/webapps/{{ resource_registry_name }}/WEB-INF/lib
|
|
||||||
|
- name: Unarchive the resource registry war
|
||||||
|
unarchive: copy=no src={{ smartgears_user_home }}/{{ resource_registry_file }} dest={{ smartgears_instance_path }}/webapps/{{ resource_registry_name }} creates={{ smartgears_instance_path }}/webapps/{{ resource_registry_name }}/WEB-INF/lib
|
||||||
notify: Restart smartgears
|
notify: Restart smartgears
|
||||||
|
|
||||||
- name: Install the resource registry configuration
|
- name: Install the resource registry configuration
|
||||||
template: src=config.properties.j2 dest={{ smartgears_instance_path }}/webapps/{{ resource_registry_name }}/WEB-INF/classes/config.properties mode=0440
|
template: src=config.properties.j2 dest={{ smartgears_instance_path }}/webapps/{{ resource_registry_name }}/WEB-INF/classes/config.properties mode=0440
|
||||||
|
notify: Restart smartgears
|
||||||
|
|
||||||
become: True
|
become: True
|
||||||
become_user: '{{ d4science_user }}'
|
become_user: '{{ d4science_user }}'
|
||||||
|
|
Loading…
Reference in New Issue