diff --git a/Ansible/ansible_collections/jfrog/platform/roles/artifactory/tasks/upgrade.yml b/Ansible/ansible_collections/jfrog/platform/roles/artifactory/tasks/upgrade.yml index fe38c82..f017bf0 100644 --- a/Ansible/ansible_collections/jfrog/platform/roles/artifactory/tasks/upgrade.yml +++ b/Ansible/ansible_collections/jfrog/platform/roles/artifactory/tasks/upgrade.yml @@ -27,6 +27,7 @@ owner: "{{ artifactory_user }}" group: "{{ artifactory_group }}" creates: "{{ artifactory_untar_home }}" + register: unarchived_artifactory when: (download_artifactory is succeeded) and (not ansible_check_mode) - name: Stop artifactory @@ -44,12 +45,12 @@ file: path: "{{ artifactory_home }}/app" state: absent - when: download_artifactory.changed + when: (download_artifactory.changed) or (unarchived_artifactory.changed) - name: Copy new app to artifactory app become: yes command: "cp -r {{ artifactory_untar_home }}/app/. {{ artifactory_home }}/app" - when: download_artifactory.changed + when: (download_artifactory.changed) or (unarchived_artifactory.changed) notify: restart artifactory - name: Configure artifactory license(s) @@ -59,10 +60,16 @@ dest: "{{ artifactory_home }}/var/etc/artifactory/artifactory.cluster.license" mode: 0644 when: - - artifactory_licenses is defined - - artifactory_licenses | length > 0 + - artifactory_licenses is defined + - artifactory_licenses | length > 0 notify: restart artifactory +- name: Check if included database driver is the correct version + become: yes + stat: + path: "{{ artifactory_home }}/app/artifactory/tomcat/lib/postgresql-{{ postgres_driver_version }}.jar" + register: included_database_driver + - name: Check if jdbc driver exists become: yes stat: @@ -79,6 +86,7 @@ when: - postgres_driver_download_url is defined - not database_driver.stat.exists + - not included_database_driver.stat.exists notify: restart artifactory - name: Configure installer info