From bfd38769b8370414b185629926cae36bd7b27176 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 29 Jan 2018 19:58:58 +0100 Subject: [PATCH] library/roles/smartgears/smartgears/tasks/smartgears-app.yml: Write the smartgears version into a file named SMARTGEARS_VERSION --- .../smartgears/tasks/smartgears-app.yml | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/smartgears/smartgears/tasks/smartgears-app.yml b/smartgears/smartgears/tasks/smartgears-app.yml index dc6aa04b..8b2aeee9 100644 --- a/smartgears/smartgears/tasks/smartgears-app.yml +++ b/smartgears/smartgears/tasks/smartgears-app.yml @@ -1,7 +1,7 @@ --- - name: Create a directory where to store all the smartgears related downloads to avoid cluttering the home directory file: dest={{ smartgears_downloads_dir }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} - tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'smartgears_download_dir', 'smartgears_downloads_dir' ] + tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'smartgears_download_dir', 'smartgears_downloads_dir', 'smartgears_conf' ] - name: Remove the old smartgears-distribution files under the smartgears user home directory. shell: rm -fr {{ smartgears_user_home }}/smartgears-distribution-* ; touch {{ smartgears_user_home }}/.smartgears_distribution_cleaned @@ -37,7 +37,7 @@ - name: Check if the smartgears stop script exists become: True become_user: '{{ smartgears_user }}' - stat: path=/home/{{ smartgears_user }}/stopContainer.sh + stat: path={{ smartgears_user_home }}/stopContainer.sh when: smartgears_upgrade or ( smartgears_download | changed ) register: smartgears_stop_script tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'stop_smartgears_service' ] @@ -45,7 +45,7 @@ - name: Stop the smartgears container before launching the upgrade script become: True become_user: '{{ smartgears_user }}' - shell: /home/{{ smartgears_user }}/stopContainer.sh + shell: {{ smartgears_user_home }}/stopContainer.sh when: - smartgears_upgrade or ( smartgears_download | changed ) - smartgears_stop_script.stat.exists @@ -134,10 +134,27 @@ msg: "The smartgears version is: {{ smartgears_real_version.stdout }}" tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'smartgears_conf' ] +# - name: Check if we have a smartgears version file +# stat: path={{ smartgears_user_home }}/SMARTGEARS_VERSION +# register: sm_version_file +# tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'smartgears_conf' ] + +# - name: Use the version file if we are not installing a new version +# command: cat {{ smartgears_user_home }}/SMARTGEARS_VERSION +# when: +# - sm_version_file.stat.exists +# - smartgears_download is not defined or not ( smartgears_download | changed ) +# register: smartgears_real_version +# tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'smartgears_conf' ] + - name: Set the real smartgears distribution version set_fact: smartgears_real_distribution_version="{{ smartgears_real_version.stdout }}" tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'smartgears_conf' ] +- name: Put the smartgears version into a file + copy: content={{ smartgears_real_distribution_version }} dest={{ smartgears_user_home }}/SMARTGEARS_VERSION + tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'smartgears_conf' ] + - name: Install the smartgears template configuration. First part become: True become_user: '{{ smartgears_user }}'