From 07ebea657cc047f8610b09b05cffd7ec7b3074ce Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 9 Aug 2018 18:48:09 +0200 Subject: [PATCH] Refactor: fix all the 'when: variable is changed' occurrencies. --- ckan/ckan/tasks/ckan-plugins.yml | 14 +- ckan/ckan/tasks/enable-ckan.yml | 4 +- couchbase/tasks/couchbase.yml | 2 +- couchdb/tasks/couchdb-1.yml | 9 +- couchdb/tasks/couchdb-2.yml | 7 +- dnet-apt-repo/tasks/main.yml | 28 +-- drupal-org/tasks/drupal-main.yml | 16 +- foreman/tasks/foreman-packages.yml | 4 +- ghn-gcore/gcore-portal/tasks/main.yml.orig | 188 ------------------ gitblit/tasks/main.yml | 2 +- hadoop/HDP/tasks/main.yml | 2 +- jenkins/master/tasks/main.yml | 4 +- joomla-org/tasks/main.yml | 8 +- mongodb/tasks/main.yml | 18 +- nagios/tasks/dell-omsa.yml | 4 +- nemis-precise-backports-repo/tasks/main.yml | 18 +- openjdk/tasks/main.yml | 6 +- quickrank/tasks/main.yml | 4 +- redmine/tasks/redmine.yml | 4 +- revive-adserver/tasks/main.yml | 8 +- rstudio-server/tasks/main.yml | 2 +- smartgears/accounting-service/tasks/main.yml | 8 +- .../tasks/main.yml | 4 +- .../tasks/main.yml | 2 +- smartgears/catalogue_ws/tasks/main.yml | 2 +- smartgears/ckan_connector/tasks/main.yml | 4 +- .../cmems_importer_se_plugin/tasks/main.yml | 4 +- smartgears/dm_pool_manager/tasks/main.yml | 2 +- smartgears/fhn_manager/tasks/main.yml | 2 +- smartgears/gcube-oauth/tasks/main.yml | 2 +- smartgears/generic_worker/tasks/main.yml | 2 +- smartgears/geoserver_connector/tasks/main.yml | 2 +- smartgears/grsf_publisher_ws/tasks/main.yml | 2 +- smartgears/home_library/tasks/main.yml | 2 +- smartgears/ic_proxy/tasks/main.yml | 2 +- .../is_exporter_se_plugin/tasks/main.yml | 4 +- .../is_sweeper_se_plugin/tasks/main.yml | 2 +- .../oscar_importer_se_plugin/tasks/main.yml | 4 +- smartgears/quota_se_plugin/tasks/main.yml | 2 +- smartgears/quota_service/tasks/main.yml | 2 +- smartgears/r_connector/tasks/main.yml | 4 +- smartgears/resource_registry/tasks/main.yml | 4 +- .../resource_registry_handlers/tasks/main.yml | 2 +- smartgears/sdi_service/tasks/main.yml | 2 +- .../sdmx_datasource_service/tasks/main.yml | 2 +- .../sharelatex_connector/tasks/main.yml | 2 +- smartgears/sis_geotk_dt_plugin/tasks/main.yml | 4 +- smartgears/smart_executor/tasks/main.yml | 2 +- .../smartgears/tasks/smartgears-app.yml | 16 +- .../tasks/main.yml | 2 +- .../tasks/main.yml | 2 +- smartgears/spd_service/tasks/main.yml | 2 +- smartgears/storage_hub/tasks/main.yml | 2 +- timezone/tasks/main.yml | 8 +- tomcat-multiple-instances/handlers/main.yml | 4 +- ubuntu-deb-general/tasks/munin.yml | 8 +- varnish-cache/tasks/main.yml | 2 +- yii/tasks/main.yml | 2 +- 58 files changed, 117 insertions(+), 359 deletions(-) delete mode 100644 ghn-gcore/gcore-portal/tasks/main.yml.orig diff --git a/ckan/ckan/tasks/ckan-plugins.yml b/ckan/ckan/tasks/ckan-plugins.yml index 45dba24d..3563a033 100644 --- a/ckan/ckan/tasks/ckan-plugins.yml +++ b/ckan/ckan/tasks/ckan-plugins.yml @@ -31,7 +31,7 @@ - name: Initialize the CKAN ckanext-harvest plugin shell: . /usr/lib/ckan/default/bin/activate ; paster --plugin=ckanext-harvest harvester initdb --config={{ ckan_config_file }} when: - - ( ckanext_harvest_install | changed ) + - ckanext_harvest_install is changed - ckan_init_db_and_solr tags: [ 'ckan', 'geonetwork', 'ckan_plugins' ] @@ -50,7 +50,7 @@ - name: Initialize the CKAN ckanext-spatial plugin shell: . /usr/lib/ckan/default/bin/activate ; paster --plugin=ckanext-spatial spatial initdb --config={{ ckan_config_file }} when: - - ( ckanext_spatial_install | changed ) + - ckanext_spatial_install is changed - ckan_init_db_and_solr tags: [ 'ckan', 'ckan_spatial', 'ckan_plugins' ] @@ -80,7 +80,7 @@ - name: Install the CKAN Geonetwork plugin code shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-geonetwork ; python setup.py develop - when: ( install_geonetwork_harvester | changed ) + when: install_geonetwork_harvester is changed notify: Restart CKAN tags: [ 'ckan', 'ckan_geonetwork', 'ckan_plugins' ] @@ -126,7 +126,7 @@ - name: Enable the CKAN ldap plugin code shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-ldap ; python setup.py develop - when: ( install_ldap_plugin | changed ) + when: install_ldap_plugin is changed notify: Restart CKAN tags: [ 'ckan', 'ckan_ldap', 'ckan_plugins' ] @@ -138,7 +138,7 @@ - name: Activate the CKAN Lire plugin code shell: . /usr/lib/ckan/default/bin/activate ; cd {{ ckan_virtenv }}/src/ckanext-lire ; pip install -e ./ - when: ( install_lire_plugin | changed ) + when: install_lire_plugin is changed notify: Restart CKAN tags: [ 'ckan', 'ckan_lire', 'ckan_plugins' ] @@ -168,7 +168,7 @@ - name: Setup the CKAN google analytics plugin shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-googleanalytics ; python setup.py develop - when: ( install_ckan_google_analytics | changed ) + when: install_ckan_google_analytics is changed notify: Restart CKAN tags: [ 'ckan', 'ckan_google_analytics', 'ckan_plugins' ] @@ -181,7 +181,7 @@ - name: Setup the CKAN google analytics reports plugin shell: . /usr/lib/ckan/default/bin/activate ; cd /usr/lib/ckan/default/src/ckanext-ga-report ; paster initdb --config={{ ckan_config_file }} when: - - ( install_ckan_ga_reports | changed ) + - install_ckan_ga_reports is changed - ckan_init_db_and_solr notify: Restart CKAN tags: [ 'ckan', 'ckan_google_analytics', 'ckan_ga_reports', 'ckan_plugins' ] diff --git a/ckan/ckan/tasks/enable-ckan.yml b/ckan/ckan/tasks/enable-ckan.yml index 07112c35..19b3ab50 100644 --- a/ckan/ckan/tasks/enable-ckan.yml +++ b/ckan/ckan/tasks/enable-ckan.yml @@ -1,11 +1,11 @@ --- - name: Restart apache service: name=apache2 state=restarted enabled=yes - when: ( ckan_install | changed ) + when: ckan_install is changed tags: ckan - name: Restart nginx service: name=nginx state=restarted enabled=yes - when: ( ckan_install | changed ) + when: ckan_install is changed tags: ckan diff --git a/couchbase/tasks/couchbase.yml b/couchbase/tasks/couchbase.yml index acdbe02d..7350dfcc 100644 --- a/couchbase/tasks/couchbase.yml +++ b/couchbase/tasks/couchbase.yml @@ -6,7 +6,7 @@ - name: Update the apt cache if needed apt: update_cache=yes - when: ( couchbase_repo_pkg | changed ) + when: couchbase_repo_pkg is changed - name: Install the couchbase community server package apt: pkg={{ item }} update_cache=yes cache_valid_time=3600 diff --git a/couchdb/tasks/couchdb-1.yml b/couchdb/tasks/couchdb-1.yml index 790508fa..d10b4052 100644 --- a/couchdb/tasks/couchdb-1.yml +++ b/couchdb/tasks/couchdb-1.yml @@ -2,15 +2,10 @@ # This is the playbook that installs couchdb 1.x # - name: Add the ppa for couchdb - apt_repository: repo='{{ couchdb_ppa }}' + apt_repository: repo='{{ couchdb_ppa }}' update_cache=yes register: install_ppa tags: couchdb -- name: Update the apt cache if needed - apt: update_cache=yes - when: ( install_ppa | changed ) - tags: couchdb - - name: Install the couchdb packages apt: pkg={{ item }} state={{ couchdb_pkg_state }} with_items: couchdb_pkgs @@ -34,7 +29,7 @@ with_items: couchdb_admin_users when: - couchdb_set_admin -# - admin_init is defined and ( admin_init | changed ) +# - admin_init is defined and admin_init is changed notify: Restart couchdb tags: [ 'couchdb', 'couch_opts'] diff --git a/couchdb/tasks/couchdb-2.yml b/couchdb/tasks/couchdb-2.yml index 2309383e..fb3eda86 100644 --- a/couchdb/tasks/couchdb-2.yml +++ b/couchdb/tasks/couchdb-2.yml @@ -4,15 +4,10 @@ tags: couchdb - name: Remove the couchdb ppa - apt_repository: repo='{{ couchdb_ppa }}' state=absent + apt_repository: repo='{{ couchdb_ppa }}' state=absent update_cache=yes register: update_apt_cache tags: couchdb -- name: Update the apt cache if needed - apt: update_cache=yes - when: (update_apt_cache|changed) - tags: couchdb - - name: Change the open files limit template: src=limits-couchdb.nofiles.j2 dest=/etc/security/limits.d/couchdb.nofiles.conf owner=root group=root mode=0444 tags: couchdb diff --git a/dnet-apt-repo/tasks/main.yml b/dnet-apt-repo/tasks/main.yml index aaa6d34d..326911b2 100644 --- a/dnet-apt-repo/tasks/main.yml +++ b/dnet-apt-repo/tasks/main.yml @@ -3,28 +3,16 @@ apt_key: url=http://ppa.research-infrastructures.eu/system/keys/system-archive.asc state=present when: has_apt register: update_apt_cache - tags: - - dnet - -- name: Install the D-Net apt repositories - apt_repository: repo='{{ item }}' - with_items: - - deb http://ppa.research-infrastructures.eu/dnet lucid main - - deb http://ppa.research-infrastructures.eu/dnet unstable main - when: has_apt - register: update_apt_cache - tags: - - dnet + tags: dnet - name: Install the D-NET repository key action: apt_key url=http://ppa.research-infrastructures.eu/dnet/keys/dnet-archive.asc - tags: - - dnet + tags: dnet -- name: Update the apt cache - apt: update_cache=yes - when: update_apt_cache.changed - ignore_errors: True - tags: - - dnet +- name: Install the D-Net apt repositories + apt_repository: repo='{{ item }}' update_cache=yes + with_items: + - deb http://ppa.research-infrastructures.eu/dnet lucid main + - deb http://ppa.research-infrastructures.eu/dnet unstable main + tags: dnet diff --git a/drupal-org/tasks/drupal-main.yml b/drupal-org/tasks/drupal-main.yml index 6fede237..3bc2229d 100644 --- a/drupal-org/tasks/drupal-main.yml +++ b/drupal-org/tasks/drupal-main.yml @@ -24,7 +24,7 @@ - name: Unpack the drupal tar file unarchive: copy=no src={{ drupal_download_dir }}/{{ drupal_dist_file }} dest={{ drupal_download_dir }} - when: ( drupal_download | changed ) + when: drupal_download is changed tags: drupal - name: Move the drupal files to the right place @@ -32,7 +32,7 @@ args: creates: '{{ drupal_install_dir }}/{{ item.virthost }}/index.php' with_items: '{{ phpfpm_pools }}' - when: ( drupal_download | changed ) + when: drupal_download is changed register: unpack_drupal tags: drupal @@ -42,7 +42,7 @@ creates: '{{ drupal_install_dir }}/{{ item.virthost }}/sites/default/settings.php' with_items: '{{ phpfpm_pools }}' when: - - ( unpack_drupal | changed ) + - unpack_drupal is changed - '{{ drupal_major_ver }} >= 8' tags: drupal @@ -52,30 +52,30 @@ creates: '{{ drupal_install_dir }}/{{ item.virthost }}/sites/default/services.yml' with_items: '{{ phpfpm_pools }}' when: - - ( unpack_drupal | changed ) + - unpack_drupal is changed - '{{ drupal_major_ver }} >= 8' tags: drupal - name: Create the files directory file: dest={{ drupal_install_dir }}/{{ item.virthost }}/sites/default/files owner={{ item.user }} group={{ item.group }} mode=0775 state=directory with_items: '{{ phpfpm_pools }}' - when: ( unpack_drupal | changed ) + when: unpack_drupal is changed tags: drupal - name: Set the correct ownership of the drupal files file: dest={{ drupal_install_dir }}/{{ item.virthost }} owner={{ item.user }} group={{ item.group }} recurse=yes state=directory with_items: '{{ phpfpm_pools }}' - when: ( unpack_drupal | changed ) + when: unpack_drupal is changed tags: drupal - name: Set the correct ownership of the drupal modules directory file: dest={{ drupal_install_dir }}/{{ item.virthost }}/modules owner={{ item.user }} group={{ http_group }} recurse=yes state=directory mode=0775 with_items: '{{ phpfpm_pools }}' - when: ( unpack_drupal | changed ) + when: unpack_drupal is changed tags: drupal - name: Remove the original drupal unpacked distribution file: dest={{ drupal_download_dir }}/{{ drupal_dist_name }} state=absent - when: ( unpack_drupal | changed ) + when: unpack_drupal is changed tags: drupal diff --git a/foreman/tasks/foreman-packages.yml b/foreman/tasks/foreman-packages.yml index dc0cf6de..47ff18d6 100644 --- a/foreman/tasks/foreman-packages.yml +++ b/foreman/tasks/foreman-packages.yml @@ -6,7 +6,7 @@ - name: Install the puppetlabs repo package apt: deb=/srv/{{ foreman_puppetlabs_repo_pkg }} update_cache=yes - when: puppetlabs_repo | changed + when: puppetlabs_repo is changed tags: foreman - name: Add the foreman repo keys @@ -29,5 +29,5 @@ #- name: Run the foremann installer # shell: foreman-installer -# when: foreman_installer_pkg | changed +# when: foreman_installer_pkg is changed # tags: foreman diff --git a/ghn-gcore/gcore-portal/tasks/main.yml.orig b/ghn-gcore/gcore-portal/tasks/main.yml.orig deleted file mode 100644 index 1018d83d..00000000 --- a/ghn-gcore/gcore-portal/tasks/main.yml.orig +++ /dev/null @@ -1,188 +0,0 @@ ---- -- name: Test if liferay is already installed - raw: ls -l /var/lib/tomcat7/webapps/ROOT/WEB-INF/classes/portal-developer.properties - register: liferay_install - ignore_errors: True - tags: - - liferay - -- name: Download the liferay war file - get_url: url="http://downloads.sourceforge.net/project/lportal/Liferay%20Portal/6.1.2%20GA3/liferay-portal-6.1.2-ce-ga3-20130816114619181.war?r=http%3A%2F%2Fwww.liferay.com%2Fit%2Fdownloads%2Fliferay-portal%2Fadditional-files&ts=1383123826&use_mirror=garr" dest=/var/tmp/liferay-6.1.war - when: liferay_install.rc != 0 - tags: - - liferay - -- name: Explode the liferay war - shell: cd /var/lib/tomcat7/webapps/ROOT ; jar xf /var/tmp/liferay-6.1.war ; chown -R root:root . ; rm -f /var/tmp/liferay-6.1.war - when: liferay_install.rc != 0 - notify: - tomcat7 restart - tags: - - liferay - -- name: Create the /usr/share/tomcat7/lib/ext directory - file: dest=/usr/share/tomcat7/lib/ext state=directory owner=root group=root mode=0755 - tags: - - liferay - -- name: Install other liferay dependencies (taken from the liferay bundle) - copy: src={{ item }} dest=/usr/share/tomcat7/lib/ext/{{ item }} - with_items: - - activation.jar - - ccpp.jar -# - hsql.jar - - jms.jar - - jta.jar - - jtds.jar - - junit.jar - - jutf7.jar - - mail.jar -# - mysql.jar - - persistence.jar - - portal-service.jar - - portlet.jar -# - postgresql.jar - - support-tomcat.jar - notify: tomcat7 restart - tags: - - liferay - -- name: Install liferay patch for ldap without using the test password - copy: src={{ item }} dest=/var/lib/tomcat7/webapps/ROOT/WEB-INF/lib/{{ item }} - with_items: - - lps9001-ldap-ce6101-portal-impl.jar - when: liferay_ldap_fix is defined and liferay_ldap_fix == 'True' - notify: tomcat7 restart - tags: - - liferay - - liferaycfg - -- name: Ensure that the ldap authentication patch is not installed - file: dest=/var/lib/tomcat7/webapps/ROOT/WEB-INF/lib/{{ item }} state=absent - with_items: - - lps9001-ldap-ce6101-portal-impl.jar - when: liferay_ldap_fix is not defined or liferay_ldap_fix == 'False' - notify: tomcat7 restart - tags: - - liferay - - liferaycfg - -- name: Create the funny /var/lib/tomcat7/temp/liferay/com/liferay/portal/deploy/dependencies directory - file: dest=/var/lib/tomcat7/temp/liferay/com/liferay/portal/deploy/dependencies state=directory owner=root group=root mode=0755 - tags: - - liferay - -- name: Create the temp directory /var/lib/tomcat7/temp - file: dest=/var/lib/tomcat7/temp owner=tomcat7 group=tomcat7 mode=0750 state=directory - tags: - - liferay - -- name: Create the funny path needed by some liferay dependencies - file: dest=/var/lib/tomcat7/temp/liferay/com/liferay/portal/deploy/dependencies state=directory owner=root group=root mode=0755 - tags: - - liferay - -- name: Install other liferay dependencies in funny places - copy: src=../files/{{ item }} dest=/var/lib/tomcat7/temp/liferay/com/liferay/portal/deploy/dependencies/{{ item }} - with_items: - - resin.jar - - script-10.jar - notify: - tomcat7 restart - tags: - - liferay - -# -# Note: we have the dependencies as local files. The two following tasks are not needed anymore -# -# - name: get the liferay dependencies -# get_url: url="http://downloads.sourceforge.net/project/lportal/Liferay%20Portal/6.1.2%20GA3/liferay-portal-dependencies-6.1.2-ce-ga3-20130816114619181.zip?r=http%3A%2F%2Fwww.liferay.com%2Fit%2Fdownloads%2Fliferay-portal%2Fadditional-files&ts=1383130399&use_mirror=garr" dest=/var/tmp/liferay-dependencies.zip -# register: dependencies_download - -# - name: Install the liferay dependencies -# shell: cd /usr/share/tomcat7/lib ; unzip /var/tmp/liferay-dependencies.zip ; chown -R root:root . ; ln -s */*.jar ./ext ; /bin/rm -f ./ext/hsql.jar -# when: dependencies_download.changed -# notify: tomcat7 restart - -- name: liferay basic configuration - template: src=../templates/portal-ext.properties.j2 dest=/var/lib/tomcat7/webapps/ROOT/WEB-INF/classes/portal-ext.properties owner=root group=tomcat7 mode=0640 - notify: - tomcat7 restart - tags: - - liferay - - liferaycfg - -- name: Create the portal home directory outside the webapp root - file: dest={{ liferay.portal_home }} state=directory owner=tomcat7 group=tomcat7 mode=0750 - tags: - - liferay - - liferaycfg - -- name: Create data and deploy directories - file: dest={{ liferay.portal_home }}/{{ item }} state=directory owner=tomcat7 group=tomcat7 mode=0750 - with_items: - - data - - deploy - - liferay - tags: - - liferay - - liferaycfg - -- name: Force the logs in the right place - file: src=/var/log/tomcat7 dest={{ liferay.portal_home }}/logs state=link - tags: - - liferay - - liferaycfg - -- name: Give write permissions to some directories - file: dest=/var/lib/tomcat7/webapps/ROOT/html/{{ item }} state=directory owner=tomcat7 group=tomcat7 - with_items: - - icons - - themes - notify: Recursively set liferay write permissions - tags: - - liferay - - liferaycfg - -- name: Put the static properties in the portal home directory - template: src=../templates/home-portal-ext.properties.j2 dest={{ liferay.portal_home }}/portal-ext.properties owner=root group=tomcat7 mode=0640 - notify: tomcat7 restart - tags: - - liferay - - liferaycfg - -- name: Create an empty portal-setup-wizard.properties if does not exist - copy: content="" dest={{ liferay.portal_home }}/portal-setup-wizard.properties owner=root group=tomcat7 mode=0660 force=no - tags: - - liferay - - liferaycfg - -- name: Test if the related webapps are installed - raw: ls -l /var/lib/tomcat7/webapps/marketplace-portlet - register: liferay_bundled_apps - ignore_errors: True - tags: - - liferay - -- name: Download the liferay bundle. Needed for the related webapps - get_url: url="http://downloads.sourceforge.net/project/lportal/Liferay%20Portal/6.1.2%20GA3/liferay-portal-tomcat-6.1.2-ce-ga3-20130816114619181.zip?r=http%3A%2F%2Fwww.liferay.com%2Fit%2Fdownloads%2Fliferay-portal%2Favailable-releases&ts=1383043780&use_mirror=garr" dest=/var/tmp/liferay-bundle.zip - when: liferay_bundled_apps.rc != 0 - tags: - - liferay - -- name: Explode the liferay bundle and install the needed webapps - shell: cd /var/tmp ; /var/lib/tomcat7/webapps/ROOT ; unzip /var/tmp/liferay-bundle.zip ; cd /var/tmp/liferay-portal-6.1.2-ce-ga3/tomcat-7.0.40/webapps ; cp -a marketplace-portlet portal-compat-hook resources-importer-web welcome-theme /var/lib/tomcat7/webapps/ ; cd /var/tmp ; rm -fr /var/tmp/liferay-bundle.zip /var/tmp/liferay-portal-6.1.2-ce-ga3 - when: liferay_bundled_apps.rc != 0 - notify: - tomcat7 restart - tags: - - liferay - -- name: The images directory of the theme must be writeable by tomcat(!) - file: dest=/var/lib/tomcat7/webapps/welcome-theme/images state=directory owner=tomcat7 group=tomcat7 mode=0750 - notify: - Recursively change welcome-theme images permissions - tags: - - liferay - - liferaycfg - diff --git a/gitblit/tasks/main.yml b/gitblit/tasks/main.yml index 1862e563..0eee6adf 100644 --- a/gitblit/tasks/main.yml +++ b/gitblit/tasks/main.yml @@ -26,7 +26,7 @@ - name: Initialize the data directory shell: cp -rp /srv/gitblit-{{ gitblit_version }}/data/* {{ gitblit_data_dir }} ; chown -R {{ gitblit_user }}:{{ gitblit_user }} {{ gitblit_data_dir }} - when: ( gitblit_data_dir_setup | changed ) + when: gitblit_data_dir_setup is changed tags: gitblit - name: Install the customized gitblit.properties file diff --git a/hadoop/HDP/tasks/main.yml b/hadoop/HDP/tasks/main.yml index d2118da6..859b3d6a 100644 --- a/hadoop/HDP/tasks/main.yml +++ b/hadoop/HDP/tasks/main.yml @@ -9,7 +9,7 @@ - name: Update the apt cache apt: update_cache=yes - when: ( ambari_repo | changed ) + when: ambari_repo is changed - name: Install the ambari server apt: pkg=ambari-server state=latest update_cache=yes cache_valid_time=1800 diff --git a/jenkins/master/tasks/main.yml b/jenkins/master/tasks/main.yml index 63365dba..8c47f4db 100644 --- a/jenkins/master/tasks/main.yml +++ b/jenkins/master/tasks/main.yml @@ -70,13 +70,13 @@ - name: Check if restart is required by any of the versioned plugins set_fact: jenkins_restart_required: yes - when: item.changed + when: item is changed with_items: '{{ my_jenkins_plugin_versioned.results }}' - name: Check if restart is required by any of the unversioned plugins set_fact: jenkins_restart_required: yes - when: item.changed + when: item is changed with_items: '{{ my_jenkins_plugin_unversioned.results }}' - name: Restart Jenkins if required diff --git a/joomla-org/tasks/main.yml b/joomla-org/tasks/main.yml index df388285..adbec9b5 100644 --- a/joomla-org/tasks/main.yml +++ b/joomla-org/tasks/main.yml @@ -26,23 +26,23 @@ - name: Unpack the joomla distribution file unarchive: copy=no src={{ joomla_download_dir }}/{{ joomla_dist_file }} dest={{ joomla_download_dir }}/joomla-unpacked - when: ( joomla_download | changed ) + when: joomla_download is changed - name: Move the joomla files to the right place shell: cp -a {{ joomla_download_dir }}/joomla-unpacked/* {{ joomla_install_dir }}/ args: creates: '{{ joomla_install_dir }}/index.php' with_items: '{{ phpfpm_pools }}' - when: ( joomla_download | changed ) + when: joomla_download is changed register: unpack_joomla - name: Set the correct ownership of the joomla files file: dest={{ joomla_install_dir }} owner={{ item.user }} group={{ item.group }} recurse=yes state=directory with_items: '{{ phpfpm_pools }}' - when: ( unpack_joomla | changed ) + when: unpack_joomla is changed - name: Remove the original joomla unpacked distribution command: rm -fr {{ joomla_download_dir }}/{{ joomla_dist_name }} - when: ( unpack_joomla | changed ) + when: unpack_joomla is changed tags: joomla diff --git a/mongodb/tasks/main.yml b/mongodb/tasks/main.yml index ff469c89..35bbe9a9 100644 --- a/mongodb/tasks/main.yml +++ b/mongodb/tasks/main.yml @@ -13,7 +13,7 @@ - name: Update the apt cache apt: update_cache=yes - when: ( external_repo | changed ) + when: external_repo is changed ignore_errors: True tags: mongodb @@ -35,24 +35,8 @@ - mongodb_install_from_external_repo - mongodb_install_packages - not mongodb_latest_version -# - not mongodb-org_version tags: mongodb -#- name: Install the mongodb-org server -# apt: pkg={{ item }}={{ mongodb_specific_version }} state=present -# with_items: -# - mongodb-org -# - mongodb-org-server -# - mongodb-org-shell -# - mongodb-org-mongos -# - mongodb-org-tools -# when: -# - mongodb_install_from_external_repo -# - mongodb_install_packages -# - not mongodb_latest_version -# - mongodb-org_version -# tags: mongodb - - name: Install the mongodb server apt: pkg={{ item }} state=installed with_items: diff --git a/nagios/tasks/dell-omsa.yml b/nagios/tasks/dell-omsa.yml index 58389645..27c462e6 100644 --- a/nagios/tasks/dell-omsa.yml +++ b/nagios/tasks/dell-omsa.yml @@ -20,7 +20,7 @@ - name: Update apt cache apt: update_cache=yes - when: ( update_apt_cache | changed ) + when: update_apt_cache is changed tags: [ 'dell', 'nagios' ] #- action: apt_key id=1285491434D8786F state=present @@ -67,7 +67,7 @@ - name: Install libssl0.9.8_0.9.8o-4squeeze14_amd64.deb on debian 7 shell: /usr/bin/dpkg -i /var/lib/libssl0.9.8_0.9.8o-4squeeze14_amd64.deb - when: ( libssl_legacy | changed ) + when: libssl_legacy is changed tags: [ 'dell', 'nagios' ] - name: Install the main Dell OMSA package diff --git a/nemis-precise-backports-repo/tasks/main.yml b/nemis-precise-backports-repo/tasks/main.yml index 932c3c8f..c0bc0d2e 100644 --- a/nemis-precise-backports-repo/tasks/main.yml +++ b/nemis-precise-backports-repo/tasks/main.yml @@ -2,23 +2,11 @@ - name: apt key for the internal precise-backports repository apt_key: url=http://ppa.research-infrastructures.eu/precise-backports/keys/precise-backports.asc state=present when: is_precise - register: update_apt_cache - tags: - - apt + tags: apt - name: Install the precise backports apt repository - apt_repository: repo='{{ item }}' + apt_repository: repo='{{ item }}' update_cache=yes with_items: - deb http://ppa.research-infrastructures.eu/precise-backports precise main when: is_precise - register: update_apt_cache - tags: - - apt - -- name: Update the apt cache - apt: update_cache=yes - when: ( update_apt_cache | changed ) - ignore_errors: True - tags: - - apt - + tags: apt diff --git a/openjdk/tasks/main.yml b/openjdk/tasks/main.yml index b11725d7..03e22174 100644 --- a/openjdk/tasks/main.yml +++ b/openjdk/tasks/main.yml @@ -3,7 +3,7 @@ - name: Add the openjdk ppa. To have openjdk 8/9 on precise and trusty apt_repository: repo='{{ openjdk_ppa }}' update_cache=yes - - name: install OpenJDK JRE + - name: Install OpenJDK apt: pkg=openjdk-{{ item.0 }}-{{ item[1] }} state={{ openjdk_pkg_state }} update_cache=yes cache_valid_time=3600 with_nested: - '{{ openjdk_version }}' @@ -13,11 +13,11 @@ - name: Rebuild the Ubuntu keystore command: update-ca-certificates --fresh - when: ( openjdk_installed | changed ) + when: openjdk_installed is changed - name: Set the default OpenJDK shell: update-java-alternatives -s java-1.{{ item }}.0-openjdk-amd64 with_items: '{{ openjdk_default }}' - when: ( openjdk_installed | changed ) + when: openjdk_installed is changed tags: [ 'jdk', 'openjdk' ] diff --git a/quickrank/tasks/main.yml b/quickrank/tasks/main.yml index 1b43aa63..02e0de1d 100644 --- a/quickrank/tasks/main.yml +++ b/quickrank/tasks/main.yml @@ -31,12 +31,12 @@ - name: Configure the sources and compile them shell: cd /home/{{ d4science_user }}/quickrank ; rm -fr build ; mkdir build ; cd /home/{{ d4science_user }}/quickrank/build ; cmake .. -DCMAKE_CXX_COMPILER=g++-5 -DCMAKE_BUILD_TYPE=Release ; make - when: ( quickrank_src | changed ) + when: quickrank_src is changed - name: Install the quickrank binaries become_user: "{{ d4science_ansible_become_user | default('root') }}" shell: cd /home/{{ d4science_user }}/quickrank/bin ; install -m 755 quicklearn /usr/local/bin - when: ( quickrank_src | changed ) + when: quickrank_src is changed become: True become_user: '{{ d4science_user }}' diff --git a/redmine/tasks/redmine.yml b/redmine/tasks/redmine.yml index ead0f3b8..6d9129fc 100644 --- a/redmine/tasks/redmine.yml +++ b/redmine/tasks/redmine.yml @@ -82,12 +82,12 @@ - name: Initialize the DB shell: cd {{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}; RAILS_ENV=production rake db:migrate - when: redmine_install.changed + when: redmine_install is changed tags: redmine - name: Install the defauld DB data shell: cd {{ redmine_glob_root_dir }}/{{ redmine_inst_dir }}; RAILS_ENV=production REDMINE_LANG=en rake redmine:load_default_data - when: redmine_install.changed + when: redmine_install is changed tags: redmine - name: Install the packages needed by plugins or to build plugins required gems diff --git a/revive-adserver/tasks/main.yml b/revive-adserver/tasks/main.yml index 5ee4b13e..70fc3d28 100644 --- a/revive-adserver/tasks/main.yml +++ b/revive-adserver/tasks/main.yml @@ -17,14 +17,14 @@ - name: Unpack the revive adserver distribution file unarchive: src={{ revive_ad_install_dir }}/revive-adserver-{{ revive_ad_version }}.tar.gz dest={{ revive_ad_dest_dir }} copy=no - when: ( ad_download | changed ) + when: ad_download is changed tags: - revive - revive_adserver - name: Fix the global permissions on the revive adserver directory command: chown -R root:root {{ revive_ad_dest_dir }}/revive-adserver-{{ revive_ad_version }} - when: ( ad_download | changed ) + when: ad_download is changed tags: - revive - revive_adserver @@ -48,14 +48,14 @@ - name: Give the revive user the permission to write inside a list of directories command: chown -R {{ revive_ad_user }} {{ revive_ad_dest_dir }}/{{ item }} with_items: revive_writable_dirs - #when: ( ad_download | changed ) + #when: ad_download is changed tags: - revive - revive_adserver - name: Give the revive user the permission to write inside the images directories command: chown -R {{ revive_ad_user }} {{ revive_ad_images_dest_dir }} - #when: ( ad_download | changed ) + #when: ad_download is changed tags: - revive - revive_adserver diff --git a/rstudio-server/tasks/main.yml b/rstudio-server/tasks/main.yml index abf7d66f..de02b9f7 100644 --- a/rstudio-server/tasks/main.yml +++ b/rstudio-server/tasks/main.yml @@ -15,7 +15,7 @@ - name: Install the rstudio server package command: gdebi -n -q /srv/{{ rstudio_file }} - when: ( rstudio_download | changed ) + when: rstudio_download is changed - name: Change the apparmor behaviour to complain, otherwise it cannot read the nslcd socket shell: RETVAL='' ; if [ -x /usr/sbin/apparmor_status ] ; then APPARMOR_STATE=$( /usr/sbin/apparmor_status ) ; RETVAL=$? ; if [ $RETVAL -eq 0 ] ; then aa-complain /usr/lib/rstudio-server/bin/rserver ; fi ; fi diff --git a/smartgears/accounting-service/tasks/main.yml b/smartgears/accounting-service/tasks/main.yml index 059b539c..26db937e 100644 --- a/smartgears/accounting-service/tasks/main.yml +++ b/smartgears/accounting-service/tasks/main.yml @@ -19,19 +19,19 @@ - name: Remove the old accounting service app file: dest={{ smartgears_instance_path }}/webapps/{{ accounting_service_name }} state=absent - when: ( accounting_download | changed ) + when: accounting_download is changed - name: Remove the accounting service library shell: rm -fr {{ smartgears_instance_path }}/lib/{{ accounting_service_library_name }}-* - when: ( accounting_download | changed ) + when: accounting_download is changed - name: Remove the accounting couchbase library if present shell: rm -fr {{ smartgears_instance_path }}/lib/{{ accounting_couchbase_library_name }}-* - when: ( accounting_download | changed ) + when: accounting_download is changed - name: Get the couchbase library maven_artifact: artifact_id={{ accounting_couchbase_library_name }} version={{ accounting_couchbase_library_version | default('latest') }} group_id={{ accounting_couchbase_library_group_id }} extension={{ accounting_couchbase_library_extension | default('war') }} repository_url={{ smartgears_global_base_url }} classifier={{ accounting_service_library_classifier }} dest={{ smartgears_instance_path }}/lib - when: ( accounting_download | changed ) + when: accounting_download is changed - name: Copy the accounting_service war file to the destination place copy: src={{ smartgears_downloads_dir }}/{{ accounting_service_file }} dest={{ smartgears_instance_path }}/webapps/{{ accounting_service_name }}.{{ accounting_service_extension }} remote_src=yes force=yes diff --git a/smartgears/accounting_aggregator_se_plugin/tasks/main.yml b/smartgears/accounting_aggregator_se_plugin/tasks/main.yml index 09560e10..f879a2c2 100644 --- a/smartgears/accounting_aggregator_se_plugin/tasks/main.yml +++ b/smartgears/accounting_aggregator_se_plugin/tasks/main.yml @@ -17,7 +17,7 @@ - name: Remove the old accounting_aggregator smart executor plugin file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ accounting_aggregator_se_plugin_name }} state=absent - when: ( accounting_aggregator_download | changed ) + when: accounting_aggregator_download is changed notify: Restart smartgears - name: Create the plugin directory inside the smart executor @@ -26,7 +26,7 @@ - name: Unarchive the accounting_aggregator uber jar to expose its libraries unarchive: src={{ smartgears_downloads_dir }}/{{ accounting_aggregator_se_plugin_uber_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ accounting_aggregator_se_plugin_name }}/ copy=no - when: (accounting_aggregator_create_dir | changed) + when: accounting_aggregator_create_dir is changed notify: Restart smartgears - name: Download the accounting_aggregator plugin jar file diff --git a/smartgears/accounting_rstudio_se_plugin/tasks/main.yml b/smartgears/accounting_rstudio_se_plugin/tasks/main.yml index 8817e633..5ae0e099 100644 --- a/smartgears/accounting_rstudio_se_plugin/tasks/main.yml +++ b/smartgears/accounting_rstudio_se_plugin/tasks/main.yml @@ -19,7 +19,7 @@ - name: Remove the old accounting insert storage plugin shell: rm -f {{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ accounting_insert_rstudio_se_plugin_artifact_id }}-*-{{ accounting_insert_rstudio_se_plugin_classifier }}.{{ accounting_insert_rstudio_se_plugin_extension }} - when: (accounting_insert_rstudio_download | changed) + when: accounting_insert_rstudio_download is changed - name: Copy the accounting aggregator plugin to its final destination copy: src={{ smartgears_downloads_dir }}/{{ accounting_insert_rstudio_se_plugin_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ accounting_insert_rstudio_se_plugin_file }} remote_src=yes diff --git a/smartgears/catalogue_ws/tasks/main.yml b/smartgears/catalogue_ws/tasks/main.yml index c5e80609..bb595121 100644 --- a/smartgears/catalogue_ws/tasks/main.yml +++ b/smartgears/catalogue_ws/tasks/main.yml @@ -19,7 +19,7 @@ - name: Remove the old catalogue ws files file: path={{ smartgears_instance_path }}/webapps/{{ catalogue_ws_name }} state=absent - when: ( catalogue_ws_download | changed ) + when: catalogue_ws_download is changed - name: Copy the catalogue ws war into the tomcat webapps directory copy: src={{ smartgears_downloads_dir }}/{{ catalogue_ws_file }} dest={{ smartgears_instance_path }}/webapps/{{ catalogue_ws_name }}.{{ catalogue_ws_extension }} remote_src=yes force=yes diff --git a/smartgears/ckan_connector/tasks/main.yml b/smartgears/ckan_connector/tasks/main.yml index 5399c5d2..5ba7a4d1 100644 --- a/smartgears/ckan_connector/tasks/main.yml +++ b/smartgears/ckan_connector/tasks/main.yml @@ -26,12 +26,12 @@ with_items: - '{{ smartgears_instance_path }}/webapps/{{ ckan_connector_name }}' - '{{ smartgears_instance_path }}/webapps/{{ ckan_connector_name }}.{{ ckan_connector_extension }}' - when: ( ckan_connector_download | changed ) + when: ckan_connector_download is changed notify: Restart smartgears - name: Create the CKAN connector webapp directory file: dest={{ smartgears_instance_path }}/webapps/{{ ckan_connector_name }} state=directory - when: ( ckan_connector_download | changed ) + when: ckan_connector_download is changed - name: Unarchive the CKAN connector war file unarchive: copy=no src={{ smartgears_downloads_dir }}/{{ ckan_connector_filename }} dest={{ smartgears_instance_path }}/webapps/{{ ckan_connector_name }} diff --git a/smartgears/cmems_importer_se_plugin/tasks/main.yml b/smartgears/cmems_importer_se_plugin/tasks/main.yml index 252e0e46..4e4ec729 100644 --- a/smartgears/cmems_importer_se_plugin/tasks/main.yml +++ b/smartgears/cmems_importer_se_plugin/tasks/main.yml @@ -17,7 +17,7 @@ - name: Remove the old cmems-importer smart executor plugin file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ cmems_importer_se_plugin_name }} state=absent - when: ( cmems_importer_download | changed ) + when: cmems_importer_download is changed notify: Restart smartgears - name: Create the plugin directory inside the smart executor @@ -26,7 +26,7 @@ - name: Unarchive the cmems-importer uber jar to expose its libraries unarchive: src={{ smartgears_downloads_dir }}/{{ cmems_importer_se_plugin_uber_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ cmems_importer_se_plugin_name }}/ copy=no - when: (cmems_importer_create_dir | changed) + when: cmems_importer_create_dir is changed notify: Restart smartgears - name: Download the cmems-importer plugin jar file diff --git a/smartgears/dm_pool_manager/tasks/main.yml b/smartgears/dm_pool_manager/tasks/main.yml index 2ac89459..a1124fce 100644 --- a/smartgears/dm_pool_manager/tasks/main.yml +++ b/smartgears/dm_pool_manager/tasks/main.yml @@ -19,7 +19,7 @@ - name: Remove the old dm_pool_manager files file: path={{ smartgears_instance_path }}/webapps/{{ dm_pool_manager_name }} state=absent - when: ( dm_pool_manager_download | changed ) + when: dm_pool_manager_download is changed - name: Create the dm_pool_manager working directory file: path={{ smartgears_instance_path }}/webapps/{{ dm_pool_manager_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} diff --git a/smartgears/fhn_manager/tasks/main.yml b/smartgears/fhn_manager/tasks/main.yml index 0b3fb36f..fe2e5459 100644 --- a/smartgears/fhn_manager/tasks/main.yml +++ b/smartgears/fhn_manager/tasks/main.yml @@ -21,7 +21,7 @@ - name: Remove the old fhn-manager files file: path={{ smartgears_instance_path }}/webapps/{{ fhn_manager_name }} state=absent - when: ( fhn_mgr_download | changed ) + when: fhn_mgr_download is changed notify: Restart smartgears - name: Copy the fhn_manager war file to its destination place diff --git a/smartgears/gcube-oauth/tasks/main.yml b/smartgears/gcube-oauth/tasks/main.yml index 94b4907c..fb26252a 100644 --- a/smartgears/gcube-oauth/tasks/main.yml +++ b/smartgears/gcube-oauth/tasks/main.yml @@ -19,7 +19,7 @@ - name: Remove the old gcube oauth files file: path={{ smartgears_instance_path }}/webapps/gcube-{{ gcube_oauth_name }} state=absent - when: ( gcube_oauth_download | changed ) + when: gcube_oauth_download is changed notify: Restart smartgears - name: Copy the gcube_oauth war into the webapps directory diff --git a/smartgears/generic_worker/tasks/main.yml b/smartgears/generic_worker/tasks/main.yml index 5e043a85..2bb655b8 100644 --- a/smartgears/generic_worker/tasks/main.yml +++ b/smartgears/generic_worker/tasks/main.yml @@ -16,7 +16,7 @@ - name: Remove the old accounting aggregator plugin shell: rm -f {{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ smart_generic_worker_plugin_name }}-*-jar-with-dependencies.jar - when: (generic_worker_download | changed) + when: generic_worker_download is changed - name: Copy the accounting aggregator plugin to its final destination copy: src={{ smartgears_downloads_dir }}/{{ smart_generic_worker_plugin_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ smart_generic_worker_plugin_file }} remote_src=yes force=yes diff --git a/smartgears/geoserver_connector/tasks/main.yml b/smartgears/geoserver_connector/tasks/main.yml index 6821a682..d2f92b9d 100644 --- a/smartgears/geoserver_connector/tasks/main.yml +++ b/smartgears/geoserver_connector/tasks/main.yml @@ -16,7 +16,7 @@ - name: Remove the installed gcube geoserver connector before upgrading shell: rm -f {{ smartgears_instance_path }}/webapps/{{ geoserver_app_name | lower }}/WEB-INF/lib/{{ gcube_geoserver_connector_name }}*.jar - when: ( gcube_conn_download | changed ) + when: gcube_conn_download is changed notify: Restart smartgears - name: Copy the gcube geoserver connector to its destination diff --git a/smartgears/grsf_publisher_ws/tasks/main.yml b/smartgears/grsf_publisher_ws/tasks/main.yml index ace7bac2..5b5b7f04 100644 --- a/smartgears/grsf_publisher_ws/tasks/main.yml +++ b/smartgears/grsf_publisher_ws/tasks/main.yml @@ -20,7 +20,7 @@ - name: Remove the old grsf-publisher-ws files file: path={{ smartgears_instance_path }}/webapps/{{ grsf_publisher_ws_name }} state=absent notify: Restart smartgears - when: ( grsf_publisher_download | changed ) + when: grsf_publisher_download is changed - name: Copy the GRSF publisher under the webapps directory copy: src={{ smartgears_downloads_dir }}/{{ grsf_publisher_ws_file }} dest={{ smartgears_instance_path }}/webapps/{{ grsf_publisher_ws_name }}.{{ grsf_publisher_ws_extension }} remote_src=yes force=yes diff --git a/smartgears/home_library/tasks/main.yml b/smartgears/home_library/tasks/main.yml index 07fbe333..9438e897 100644 --- a/smartgears/home_library/tasks/main.yml +++ b/smartgears/home_library/tasks/main.yml @@ -18,7 +18,7 @@ - name: Remove the installed home library before upgrading file: dest={{ smartgears_instance_path }}/webapps/{{ home_library_name }} state=absent - when: ( home_library_download | changed ) + when: home_library_download is changed notify: Restart smartgears - name: Copy the home library war diff --git a/smartgears/ic_proxy/tasks/main.yml b/smartgears/ic_proxy/tasks/main.yml index 0c28b655..392e983a 100644 --- a/smartgears/ic_proxy/tasks/main.yml +++ b/smartgears/ic_proxy/tasks/main.yml @@ -18,7 +18,7 @@ - name: Remove the old ic_proxy files file: path={{ smartgears_instance_path }}/webapps/{{ ic_proxy_name }} state=absent - when: ( ic_proxy_download | changed ) + when: ic_proxy_download is changed - name: Create the ic proxy working directory file: path={{ smartgears_instance_path }}/webapps/{{ ic_proxy_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} diff --git a/smartgears/is_exporter_se_plugin/tasks/main.yml b/smartgears/is_exporter_se_plugin/tasks/main.yml index 9dc45607..5d4384b8 100644 --- a/smartgears/is_exporter_se_plugin/tasks/main.yml +++ b/smartgears/is_exporter_se_plugin/tasks/main.yml @@ -17,7 +17,7 @@ - name: Remove the old is_exporter smart executor plugin file: dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ is_exporter_se_plugin_name }} state=absent - when: ( is_exporter_download | changed ) + when: is_exporter_download is changed notify: Restart smartgears - name: Create the plugin directory inside the smart executor @@ -26,7 +26,7 @@ - name: Unarchive the is_exporter uber jar to expose its libraries unarchive: src={{ smartgears_downloads_dir }}/{{ is_exporter_se_plugin_uber_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/plugins/{{ is_exporter_se_plugin_name }}/ copy=no - when: (is_exporter_create_dir | changed) + when: is_exporter_create_dir is changed notify: Restart smartgears - name: Download the is_exporter plugin jar file diff --git a/smartgears/is_sweeper_se_plugin/tasks/main.yml b/smartgears/is_sweeper_se_plugin/tasks/main.yml index c2f59e1b..b7d73dcb 100644 --- a/smartgears/is_sweeper_se_plugin/tasks/main.yml +++ b/smartgears/is_sweeper_se_plugin/tasks/main.yml @@ -16,7 +16,7 @@ - name: Remove the old is-sweeper plugin shell: rm -f {{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ is_sweeper_se_plugin_name }}-*-{{ is_sweeper_se_plugin_classifier }}.{{ is_sweeper_se_plugin_extension }} - when: ( is_sweeper_plugin_download | changed ) + when: is_sweeper_plugin_download is changed - name: Install the is-sweeper plugin inside the smart executor lib directory copy: src={{ smartgears_downloads_dir }}/{{ is_sweeper_se_plugin_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ is_sweeper_se_plugin_file }} remote_src=yes force=yes diff --git a/smartgears/oscar_importer_se_plugin/tasks/main.yml b/smartgears/oscar_importer_se_plugin/tasks/main.yml index 7b39d927..d1c46751 100644 --- a/smartgears/oscar_importer_se_plugin/tasks/main.yml +++ b/smartgears/oscar_importer_se_plugin/tasks/main.yml @@ -16,12 +16,12 @@ - name: Remove the old oscar-importer plugin shell: rm -f {{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ oscar_importer_se_plugin_name }}-*-{{ oscar_importer_se_plugin_classifier }}.{{ oscar_importer_se_plugin_extension }} - when: ( oscar_importer_download | changed ) + when: oscar_importer_download is changed notify: Restart smartgears - name: Copy the oscar-importer plugin on the correct place copy: src={{ smartgears_downloads_dir }}/{{ oscar_importer_se_plugin_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ oscar_importer_se_plugin_file }} remote_src=yes force=yes - when: ( oscar_importer_download | changed ) + when: oscar_importer_download is changed notify: Restart smartgears - name: Install the libnetcdfc7 package diff --git a/smartgears/quota_se_plugin/tasks/main.yml b/smartgears/quota_se_plugin/tasks/main.yml index 271bafc7..0235ca64 100644 --- a/smartgears/quota_se_plugin/tasks/main.yml +++ b/smartgears/quota_se_plugin/tasks/main.yml @@ -16,7 +16,7 @@ - name: Remove the old quota plugin shell: rm -f {{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ quota_se_plugin_artifact_id }}-*-jar-with-dependencies.jar - when: (quota_storage_download | changed) + when: quota_storage_download is changed - name: Copy the quota plugin to its final destination copy: src={{ smartgears_downloads_dir }}/{{ quota_se_plugin_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ quota_se_plugin_file }} remote_src=yes diff --git a/smartgears/quota_service/tasks/main.yml b/smartgears/quota_service/tasks/main.yml index 8557d5c6..da54f7a2 100644 --- a/smartgears/quota_service/tasks/main.yml +++ b/smartgears/quota_service/tasks/main.yml @@ -19,7 +19,7 @@ - name: Remove the old quota service files file: path={{ smartgears_instance_path }}/webapps/{{ quota_service_name }} state=absent - when: ( quota_service_download | changed ) + when: quota_service_download is changed - name: Copy the quota_service war to the destination place copy: src={{ smartgears_downloads_dir }}/{{ quota_service_file }} dest={{ smartgears_instance_path }}/webapps/{{ quota_service_name }}.{{ quota_service_extension }} remote_src=yes force=yes diff --git a/smartgears/r_connector/tasks/main.yml b/smartgears/r_connector/tasks/main.yml index da1aeece..fc924594 100644 --- a/smartgears/r_connector/tasks/main.yml +++ b/smartgears/r_connector/tasks/main.yml @@ -38,11 +38,11 @@ - '{{ smartgears_instance_path }}/webapps/{{ r_connector_name }}' - '{{ smartgears_instance_path }}/webapps/{{ r_connector_name }}.{{ r_connector_extension }}' notify: Restart smartgears - when: ( r_connector_download | changed ) + when: r_connector_download is changed - name: Create the R connector webapp directory file: dest={{ smartgears_instance_path }}/webapps/{{ r_connector_name }} state=directory - when: ( r_connector_download | changed ) + when: r_connector_download is changed - name: Unarchive the R connector war file unarchive: copy=no src={{ smartgears_downloads_dir }}/{{ r_connector_filename }} dest={{ smartgears_instance_path }}/webapps/{{ r_connector_name }} diff --git a/smartgears/resource_registry/tasks/main.yml b/smartgears/resource_registry/tasks/main.yml index b8ed65bb..a3d54566 100644 --- a/smartgears/resource_registry/tasks/main.yml +++ b/smartgears/resource_registry/tasks/main.yml @@ -22,11 +22,11 @@ with_items: - '{{ smartgears_instance_path }}/webapps/{{ resource_registry_name }}' - '{{ smartgears_instance_path }}/webapps/{{ resource_registry_name }}.{{ resource_registry_extension }}' - when: ( resource_registry_download | changed ) + when: resource_registry_download is changed - name: Create the resource-registry working directory file: path={{ smartgears_instance_path }}/webapps/{{ resource_registry_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} - when: ( resource_registry_download | changed ) + when: resource_registry_download is changed - name: Unarchive the resource registry war unarchive: copy=no src={{ smartgears_downloads_dir }}/{{ resource_registry_file }} dest={{ smartgears_instance_path }}/webapps/{{ resource_registry_name }} creates={{ smartgears_instance_path }}/webapps/{{ resource_registry_name }}/WEB-INF/lib diff --git a/smartgears/resource_registry_handlers/tasks/main.yml b/smartgears/resource_registry_handlers/tasks/main.yml index cb7b8189..481d60ce 100644 --- a/smartgears/resource_registry_handlers/tasks/main.yml +++ b/smartgears/resource_registry_handlers/tasks/main.yml @@ -15,7 +15,7 @@ - name: Remove the old resource-registry-handlers file shell: rm -f {{ smartgears_instance_path }}/lib/{{ resource_registry_handlers_name }}-*.{{ resource_registry_handlers_extension }} - when: ( resource_registry_handlers_download | changed ) + when: resource_registry_handlers_download is changed - name: Copy the resource registry jar file into the tomcat lib directory copy: src={{ smartgears_downloads_dir }}/{{ resource_registry_handlers_file }} dest={{ smartgears_instance_path }}/lib/{{ resource_registry_handlers_file }} remote_src=yes force=yes diff --git a/smartgears/sdi_service/tasks/main.yml b/smartgears/sdi_service/tasks/main.yml index 8723e1e6..777a5330 100644 --- a/smartgears/sdi_service/tasks/main.yml +++ b/smartgears/sdi_service/tasks/main.yml @@ -18,7 +18,7 @@ - name: Remove the old sdi files file: path={{ smartgears_instance_path }}/webapps/{{ sdi_service_name }} state=absent - when: ( sdi_service_download | changed ) + when: sdi_service_download is changed - name: Copy the sdi service war file into the webapps directory copy: src={{ smartgears_downloads_dir }}/{{ sdi_service_file }} dest={{ smartgears_instance_path }}/webapps/{{ sdi_service_name }}.{{ sdi_extension }} remote_src=yes force=yes diff --git a/smartgears/sdmx_datasource_service/tasks/main.yml b/smartgears/sdmx_datasource_service/tasks/main.yml index 25a53f01..4886310f 100644 --- a/smartgears/sdmx_datasource_service/tasks/main.yml +++ b/smartgears/sdmx_datasource_service/tasks/main.yml @@ -18,7 +18,7 @@ - name: Remove the old service files file: path={{ smartgears_instance_path }}/webapps/{{ sdmx_datasource_service_name }} state=absent - when: ( sdmx_datasource_service_download | changed ) + when: sdmx_datasource_service_download is changed - name: Copy the service war file into the webapps directory copy: src={{ smartgears_downloads_dir }}/{{ sdmx_datasource_service_file }} dest={{ smartgears_instance_path }}/webapps/{{ sdmx_datasource_service_name }}.{{ sdmx_datasource_extension }} remote_src=yes force=yes diff --git a/smartgears/sharelatex_connector/tasks/main.yml b/smartgears/sharelatex_connector/tasks/main.yml index 15d099be..2be1f7f0 100644 --- a/smartgears/sharelatex_connector/tasks/main.yml +++ b/smartgears/sharelatex_connector/tasks/main.yml @@ -18,7 +18,7 @@ - name: Remove the old sharelatex-connector files file: path={{ smartgears_instance_path }}/webapps/{{ sharelatex_connector_name }} state=absent - when: ( sharelatex_connector_download | changed ) + when: sharelatex_connector_download is changed - name: Create the sharelatex connector webapp directory file: path={{ smartgears_instance_path }}/webapps/{{ sharelatex_connector_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} diff --git a/smartgears/sis_geotk_dt_plugin/tasks/main.yml b/smartgears/sis_geotk_dt_plugin/tasks/main.yml index f23960a7..3e11fd7a 100644 --- a/smartgears/sis_geotk_dt_plugin/tasks/main.yml +++ b/smartgears/sis_geotk_dt_plugin/tasks/main.yml @@ -15,7 +15,7 @@ - name: Remove the old Sis geotk data transfer plugin file: dest={{ smartgears_instance_path }}/webapps/{{ data_trasfer_service_name }}/WEB-INF/lib/plugins/{{ sis_geotk_dt_plugin_name }} state=absent - when: (sis_geotk_download | changed) + when: sis_geotk_download is changed - name: Create the plugin directory inside data transfer file: dest={{ smartgears_instance_path }}/webapps/{{ data_trasfer_service_name }}/WEB-INF/lib/plugins/{{ sis_geotk_dt_plugin_name }} state=directory @@ -23,7 +23,7 @@ - name: Unarchive the Sis geotk data transfer uber jar to expose its libraries unarchive: src={{ smartgears_downloads_dir }}/{{ sis_geotk_dt_plugin_uber_file }} dest={{ smartgears_instance_path }}/webapps/{{ data_trasfer_service_name }}/WEB-INF/lib/plugins/{{ sis_geotk_dt_plugin_name }}/ copy=no - when: (sis_geotk_create_dir | changed) + when: sis_geotk_create_dir is changed notify: Restart smartgears - name: Get the Sis geotk data transfer jar diff --git a/smartgears/smart_executor/tasks/main.yml b/smartgears/smart_executor/tasks/main.yml index 27ee6eeb..18784987 100644 --- a/smartgears/smart_executor/tasks/main.yml +++ b/smartgears/smart_executor/tasks/main.yml @@ -17,7 +17,7 @@ - name: Remove the old smart executor files if an upgrade is planned file: path={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }} state=absent - when: ( smartexecutor_download | changed ) + when: smartexecutor_download is changed - name: Create the smart executor working directory file: path={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }} state=directory owner={{ smartgears_user }} group={{ smartgears_user }} diff --git a/smartgears/smartgears/tasks/smartgears-app.yml b/smartgears/smartgears/tasks/smartgears-app.yml index 18bb3e1c..ebd7f710 100644 --- a/smartgears/smartgears/tasks/smartgears-app.yml +++ b/smartgears/smartgears/tasks/smartgears-app.yml @@ -21,7 +21,7 @@ - name: Remove the smartgears-distribution files shell: find {{ smartgears_downloads_dir }} -maxdepth 1 -type d -name smartgears-distribution-* -exec rm -fr {} \; ignore_errors: yes - when: ( smartgears_download | changed ) + when: smartgears_download is changed tags: [ 'smartgears', 'smartgears_distribution', 'tomcat'] - name: Unarchive the smartgears distribution @@ -31,14 +31,14 @@ with_items: '{{ tomcat_m_instances }}' when: - not item.skip_smartgears - - ( smartgears_download | changed ) + - smartgears_download is changed tags: [ 'smartgears', 'smartgears_distribution', 'tomcat' ] - name: Check if the smartgears stop script exists become: True become_user: '{{ smartgears_user }}' stat: path={{ smartgears_user_home }}/stopContainer.sh - when: smartgears_upgrade or ( smartgears_download | changed ) + when: smartgears_upgrade or ( smartgears_download is changed ) register: smartgears_stop_script tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'stop_smartgears_service' ] @@ -47,7 +47,7 @@ become_user: '{{ smartgears_user }}' shell: '{{ smartgears_user_home }}/stopContainer.sh' when: - - smartgears_upgrade or ( smartgears_download | changed ) + - smartgears_upgrade or ( smartgears_download is changed ) - smartgears_stop_script.stat.exists tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'stop_smartgears_service' ] @@ -72,7 +72,7 @@ shell: cd {{ smartgears_downloads_dir }} ; dest_dir=$( find . -type d -name smartgears-distribution-\* | tail -1 ) ; cd $dest_dir ; . /{{ item.user_home }}/.bashrc ; ./install -s tomcat with_items: '{{ tomcat_m_instances }}' when: - - ( smartgears_download | changed ) + - smartgears_download is changed - not item.skip_smartgears register: install_smartgears_app notify: Restart smartgears @@ -136,7 +136,7 @@ # command: cat {{ smartgears_user_home }}/SMARTGEARS_VERSION # when: # - sm_version_file.stat.exists -# - smartgears_download is not defined or not ( smartgears_download | changed ) +# - smartgears_download is not defined or not ( smartgears_download is changed ) # register: smartgears_real_version # tags: [ 'smartgears', 'smartgears_distribution', 'tomcat', 'smartgears_conf' ] @@ -166,7 +166,7 @@ become: True become_user: '{{ smartgears_user }}' shell: /usr/local/bin/get-scopes {{ gcube_admin_token | default('') }} -# when: gcube_admin_token is defined or ( smartgears_download | changed ) +# when: gcube_admin_token is defined or ( smartgears_download is changed ) # register: smartgears_remove_state notify: Restart smartgears tags: [ 'smartgears', 'smartgears_distribution', 'smartgears_conf', 'tomcat' ] @@ -176,7 +176,7 @@ # become: True # become_user: '{{ smartgears_user }}' # shell: . {{ smartgears_user_home }}/.bashrc ; cd {{ smartgears_user_home }}/SmartGears/scripts ; ./clean-container-state -s old_saved_scopes.xml -# when: ( smartgears_remove_state | changed ) +# when: smartgears_remove_state is changed # notify: Restart smartgears # tags: [ 'smartgears', 'smartgears_distribution', 'smartgears_conf', 'tomcat' ] diff --git a/smartgears/social-networking-library-ws/tasks/main.yml b/smartgears/social-networking-library-ws/tasks/main.yml index 075d2562..e9ba3712 100644 --- a/smartgears/social-networking-library-ws/tasks/main.yml +++ b/smartgears/social-networking-library-ws/tasks/main.yml @@ -22,7 +22,7 @@ with_items: - '{{ smartgears_instance_path }}/webapps/{{ social_networking_library_ws_name }}' - '{{ smartgears_instance_path }}/webapps/{{ social_networking_library_ws_name }}.{{ social_networking_library_ws_extension }}' - when: ( social_networking_library_ws_download | changed ) + when: social_networking_library_ws_download is changed notify: Restart smartgears - name: Copy the social_networking_library_ws war into the tomcat webapps dir diff --git a/smartgears/social_data_indexer_se_plugin/tasks/main.yml b/smartgears/social_data_indexer_se_plugin/tasks/main.yml index 691950fa..e369e0e4 100644 --- a/smartgears/social_data_indexer_se_plugin/tasks/main.yml +++ b/smartgears/social_data_indexer_se_plugin/tasks/main.yml @@ -16,7 +16,7 @@ - name: Remove the old social indexer plugin shell: rm -f {{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ social_data_indexer_se_plugin_name }}-*-jar-with-dependencies.jar - when: (social_indexer_download | changed) + when: social_indexer_download is changed - name: Copy the social indexer plugin to its final destination copy: src={{ smartgears_downloads_dir }}/{{ social_data_indexer_se_plugin_file }} dest={{ smartgears_instance_path }}/webapps/{{ smart_executor_name }}/WEB-INF/lib/{{ social_data_indexer_se_plugin_file }} remote_src=yes force=yes diff --git a/smartgears/spd_service/tasks/main.yml b/smartgears/spd_service/tasks/main.yml index db1f51ec..d181a4ad 100644 --- a/smartgears/spd_service/tasks/main.yml +++ b/smartgears/spd_service/tasks/main.yml @@ -18,7 +18,7 @@ - name: Remove the old spd files file: path={{ smartgears_instance_path }}/webapps/{{ spd_service_name }} state=absent - when: ( spd_service_download | changed ) + when: spd_service_download is changed - name: Copy the spd war into the webapps directory copy: src={{ smartgears_downloads_dir }}/{{ spd_service_file }} dest={{ smartgears_instance_path }}/webapps/{{ spd_service_name }}.{{ spd_extension }} remote_src=yes force=yes diff --git a/smartgears/storage_hub/tasks/main.yml b/smartgears/storage_hub/tasks/main.yml index dcfe4095..b68c0181 100644 --- a/smartgears/storage_hub/tasks/main.yml +++ b/smartgears/storage_hub/tasks/main.yml @@ -20,7 +20,7 @@ - name: Remove the installed storage hub before upgrading file: dest={{ smartgears_instance_path }}/webapps/{{ storage_hub_name }} state=absent - when: ( storage_hub_download | changed ) + when: storage_hub_download is changed notify: Restart smartgears - name: Get the StorageHub war diff --git a/timezone/tasks/main.yml b/timezone/tasks/main.yml index 3e279d20..c48234d9 100644 --- a/timezone/tasks/main.yml +++ b/timezone/tasks/main.yml @@ -2,12 +2,10 @@ - name: Write the timezone file template: src=etc-timezone.j2 dest=/etc/timezone owner=root group=root mode=0644 register: set_timezone - tags: - - timezone + tags: timezone - name: Reconfigure the system tzdata command: dpkg-reconfigure --frontend noninteractive tzdata - when: (set_timezone|changed) - tags: - - timezone + when: set_timezone is changed + tags: timezone diff --git a/tomcat-multiple-instances/handlers/main.yml b/tomcat-multiple-instances/handlers/main.yml index 33ba27e2..35d87044 100644 --- a/tomcat-multiple-instances/handlers/main.yml +++ b/tomcat-multiple-instances/handlers/main.yml @@ -2,13 +2,13 @@ - name: tomcat restart instances with changed configs service: name='tomcat-instance-{{ item.item.http_port }}' state=restarted sleep=20 with_items: '{{ restart_needed.results }}' - when: item.changed + when: item is changed ignore_errors: True - name: tomcat restart instances with changed jmx config service: name='tomcat-instance-{{ item.item.http_port }}' state=restarted sleep=20 with_items: '{{ jmx_restart_needed.results }}' - when: item.changed + when: item is changed ignore_errors: True - name: tomcat instances restart diff --git a/ubuntu-deb-general/tasks/munin.yml b/ubuntu-deb-general/tasks/munin.yml index e632b448..d26eb11c 100644 --- a/ubuntu-deb-general/tasks/munin.yml +++ b/ubuntu-deb-general/tasks/munin.yml @@ -13,12 +13,10 @@ - 'allow ^146\.48\.122\.15$' - 'allow ^146\.48\.123\.23$' register: munin_config - tags: - - munin + tags: munin - name: reload munin-node service: name=munin-node state=restarted - when: munin_config.changed == True - tags: - - munin + when: munin_config is changed + tags: munin diff --git a/varnish-cache/tasks/main.yml b/varnish-cache/tasks/main.yml index 1c6dc575..070ac0f8 100644 --- a/varnish-cache/tasks/main.yml +++ b/varnish-cache/tasks/main.yml @@ -46,7 +46,7 @@ - name: Reload the systemd unit when changed command: systemctl daemon-reload - when: ( install_varnish_unit | changed ) + when: install_varnish_unit is changed tags: [ 'varnish', 'varnishconf' ] - name: Ensure that the varnish service is started and enabled diff --git a/yii/tasks/main.yml b/yii/tasks/main.yml index e3d39c1b..a553a55e 100644 --- a/yii/tasks/main.yml +++ b/yii/tasks/main.yml @@ -16,7 +16,7 @@ - name: Fix the permissions on the yii framework directory command: chown -R root:root {{ yii_install_dir }}/yii-{{ yii_version }}.{{ yii_release }} - when: ( yii_unpack | changed ) + when: yii_unpack is changed tags: [ 'yii', 'yii-framework' ] - name: Create a couple of links to the running version