diff --git a/smartgears/smartgears/tasks/smartgears-app.yml b/smartgears/smartgears/tasks/smartgears-app.yml
index adb2c2f5..cfd37015 100644
--- a/smartgears/smartgears/tasks/smartgears-app.yml
+++ b/smartgears/smartgears/tasks/smartgears-app.yml
@@ -16,13 +16,13 @@
with_items: '{{ tomcat_m_instances }}'
register: smartgears_download
when: not item.skip_smartgears
- tags: [ 'smartgears', 'smartgears_distribution', 'tomcat' ]
+ tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'smartgears_conf' ]
- name: Remove the smartgears-distribution files
shell: find {{ smartgears_downloads_dir }} -type d -name smartgears-distribution-\* -exec rm -fr {} \;
ignore_errors: yes
when: ( smartgears_download | changed )
- tags: [ 'smartgears', 'smartgears_distribution', 'tomcat' ]
+ tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'smartgears_conf' ]
- name: Unarchive the smartgears distribution
become: True
@@ -78,15 +78,6 @@
notify: Restart smartgears
tags: [ 'smartgears', 'smartgears_distribution', 'tomcat' ]
-- name: Get the real smartgears version from the exploded distribution filename
- shell: /bin/ls -1 {{ smartgears_downloads_dir }} | grep smartgears-distribution | grep -v tar.gz | sed -e 's/smartgears-distribution-//g'
- 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: Create the directory where we put the smartgears configuration snippets
become: True
become_user: '{{ smartgears_user }}'
@@ -133,6 +124,20 @@
template: src=scopes.list.j2 dest=/usr/local/etc/scopes.list owner=root group={{ smartgears_user }} mode=0444
tags: [ 'smartgears', 'smartgears_distribution', 'smartgears_conf', 'tomcat' ]
+- name: Get the real smartgears version from the container.xml file contained inside the distribution
+ shell: dest_dir=$( find {{ smartgears_downloads_dir }} -type d -name smartgears-distribution-\* | tail -1 ) ; cd $dest_dir ; grep "'SmartGearsDistribution' " container.xml | awk -F "'" '{print $4}'
+ register: smartgears_real_version
+ tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'smartgears_conf' ]
+
+- name: Print the smartgears version
+ debug:
+ msg: "The smartgears version is: {{ smartgears_real_version.stdout }}"
+ 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: Install the smartgears template configuration. First part
become: True
become_user: '{{ smartgears_user }}'
diff --git a/smartgears/smartgears/templates/container.xml.j2 b/smartgears/smartgears/templates/container.xml.j2
index d57898c4..69100e35 100644
--- a/smartgears/smartgears/templates/container.xml.j2
+++ b/smartgears/smartgears/templates/container.xml.j2
@@ -26,11 +26,8 @@
{{ smartgears_authorized_on_all_scopes }}
-{% if smartgears_distribution_version == 'latest' %}
-{% else %}
-
-{% endif %}
+
{{ smartgears_publication_frequency }}
{{ smartgears_infrastructure_name }}