diff --git a/smartgears/uri_resolver/defaults/main.yml b/smartgears/uri_resolver/defaults/main.yml new file mode 100644 index 0000000..51b2953 --- /dev/null +++ b/smartgears/uri_resolver/defaults/main.yml @@ -0,0 +1,7 @@ +--- +smartgears_uri_resolver_install: False +uri_resolver_ver: latest +uri_resolver_group_id: org.gcube.data.transfer +uri_resolver_name: uri-resolver +uri_resolver_extension: war +uri_resolver_file: '{{ uri_resolver_name }}-{{ uri_resolver_ver }}.{{ uri_resolver_extension }}' diff --git a/smartgears/uri_resolver/defaults/main.yml-e b/smartgears/uri_resolver/defaults/main.yml-e new file mode 100644 index 0000000..5335164 --- /dev/null +++ b/smartgears/uri_resolver/defaults/main.yml-e @@ -0,0 +1,7 @@ +--- +grsf_api_install: False +grsf_api_ver: latest +grsf_api_group_id: gr.forth.ics.isl +grsf_api_name: grsf-api +grsf_api_extension: war +grsf_api_file: '{{ grsf_api_name }}-{{ grsf_api_ver }}.{{ grsf_api_extension }}' diff --git a/smartgears/uri_resolver/tasks/main.yml b/smartgears/uri_resolver/tasks/main.yml new file mode 100644 index 0000000..5f56e54 --- /dev/null +++ b/smartgears/uri_resolver/tasks/main.yml @@ -0,0 +1,32 @@ +--- +- block: + - name: Remove the old uri-resolver files + file: path={{ item }} state=absent + with_items: + - '{{ smartgears_instance_path }}/webapps/{{ uri_resolver_name }}' + - '{{ smartgears_instance_path }}/webapps/{{ uri_resolver_name }}.{{ uri_resolver_extension }}' + notify: Restart smartgears + + become: True + become_user: '{{ d4science_user }}' + tags: [ 'smartgears', 'uri_resolver', 'tomcat' ] + when: not smartgears_uri_resolver_install + +- block: + - name: Get the uri-resolver war + maven_artifact: artifact_id={{ uri_resolver_name }} version={{ uri_resolver_version | default(omit) }} group_id={{ uri_resolver_group_id }} extension={{ uri_resolver_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_downloads_dir }}/{{ uri_resolver_file }} verify_checksum=always + register: uri_resolver_download + + - name: Remove the old uri-resolver files + file: path={{ smartgears_instance_path }}/webapps/{{ uri_resolver_name }} state=absent + notify: Restart smartgears + when: uri_resolver_download is changed + + - name: Copy the uri-resolver war file into the webapps directory + copy: src={{ smartgears_downloads_dir }}/{{ uri_resolver_file }} dest={{ smartgears_instance_path }}/webapps/{{ uri_resolver_name }}.{{ uri_resolver_extension }} remote_src=yes force=yes + notify: Restart smartgears + + become: True + become_user: '{{ d4science_user }}' + tags: [ 'smartgears', 'uri_resolver', 'tomcat' ] + when: smartgears_uri_resolver_install diff --git a/smartgears/uri_resolver/tasks/main.yml-e b/smartgears/uri_resolver/tasks/main.yml-e new file mode 100644 index 0000000..5082926 --- /dev/null +++ b/smartgears/uri_resolver/tasks/main.yml-e @@ -0,0 +1,32 @@ +--- +- block: + - name: Remove the old grsf-api files + file: path={{ item }} state=absent + with_items: + - '{{ smartgears_instance_path }}/webapps/{{ uri_resolver_name }}' + - '{{ smartgears_instance_path }}/webapps/{{ uri_resolver_name }}.{{ uri_resolver_extension }}' + notify: Restart smartgears + + become: True + become_user: '{{ d4science_user }}' + tags: [ 'smartgears', 'uri_resolver', 'tomcat' ] + when: not uri_resolver_install + +- block: + - name: Get the grsf-api war + maven_artifact: artifact_id={{ uri_resolver_name }} version={{ uri_resolver_version | default(omit) }} group_id={{ uri_resolver_group_id }} extension={{ uri_resolver_extension | default('war') }} repository_url={{ smartgears_global_base_url }} dest={{ smartgears_downloads_dir }}/{{ uri_resolver_file }} + register: uri_resolver_download + + - name: Remove the old grsf-api files + file: path={{ smartgears_instance_path }}/webapps/{{ uri_resolver_name }} state=absent + notify: Restart smartgears + when: uri_resolver_download is changed + + - name: Copy the GRSF api war file into the webapps directory + copy: src={{ smartgears_downloads_dir }}/{{ uri_resolver_file }} dest={{ smartgears_instance_path }}/webapps/{{ uri_resolver_name }}.{{ uri_resolver_extension }} remote_src=yes force=yes + notify: Restart smartgears + + become: True + become_user: '{{ d4science_user }}' + tags: [ 'smartgears', 'uri_resolver', 'tomcat' ] + when: uri_resolver_install