From 6035220c2e47c9ac39384b5b0c91a15fc109cfd3 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Mon, 7 Mar 2016 15:08:06 +0100 Subject: [PATCH] library/roles/R/tasks/r-installation.yml: Try to fix the ansible 2 warnings. d4science-ghn-cluster/group_vars/egi_dataminer: the R packages list is not a link to the standard dataminer file anymore. d4science-ghn-cluster/group_vars/egi_smartexecutor: the R packages list is not a link to the standard smartexecutor file anymore. --- R/tasks/r-installation.yml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/R/tasks/r-installation.yml b/R/tasks/r-installation.yml index cc15266c..91448e8e 100644 --- a/R/tasks/r-installation.yml +++ b/R/tasks/r-installation.yml @@ -9,7 +9,7 @@ - name: Remove the hold state from the debian R packages shell: apt-mark unhold {{ item }} - with_items: '{{ r_base_packages_hold_list }}' + with_items: '( {{ r_base_packages_hold_list }} | default [] )' when: r_base_packages_hold_list is defined ignore_errors: True tags: [ 'r_software', 'r_pkg', 'r_pkg_hold' ] @@ -21,14 +21,14 @@ - name: When we install specific R deb packages, put them on hold shell: apt-mark hold {{ item }} - with_items: '{{ r_base_packages_hold_list }}' + with_items: '( {{ r_base_packages_hold_list }} | default [] )' when: r_base_specific_version ignore_errors: True tags: [ 'r_software', 'r_pkg', 'r_pkg_hold' ] - name: Install the R additional modules from the deb repo apt: pkg={{ item }} state={{ r_packages_state }} force=yes - with_items: '{{ r_plugins_packages_list }}' + with_items: '( {{ r_plugins_packages_list }} | default [] )' when: r_plugins_from_deb tags: [ 'r_software', 'r_pkg' ] @@ -61,7 +61,7 @@ - name: Get the R packages sources that need to be installed get_url: url={{ item.url }} dest={{ r_source_plugins_dest_dir }} - with_items: '{{ r_plugins_from_sources }}' + with_items: '( {{ r_plugins_from_sources }} | default [] )' when: r_plugins_install_specific_source tags: [ 'r_software', 'r_pkg', 'r_plugins', 'r_plugins_version' ] @@ -71,7 +71,7 @@ register: install_s_plugins_result failed_when: "install_s_plugins_result.rc != 0 or 'had non-zero exit status' in install_s_plugins_result.stderr" changed_when: '"Added" in install_s_plugins_result.stdout' - with_items: '{{ r_plugins_from_sources }}' + with_items: '( {{ r_plugins_from_sources }} | default [] )' when: r_plugins_install_specific_source ignore_errors: True tags: [ 'r_software', 'r_pkg', 'r_plugins', 'r_plugins_version' ] @@ -82,9 +82,8 @@ register: install_s_plugins_result failed_when: "install_s_plugins_result.rc != 0 or 'had non-zero exit status' in install_s_plugins_result.stderr" changed_when: '"Added" in install_s_plugins_result.stdout' - with_items: '{{ r_plugins_from_sources }}' - when: - - r_plugins_install_specific_source + with_items: '( {{ r_plugins_from_sources }} | default [] )' + when: r_plugins_install_specific_source tags: [ 'r_software', 'r_pkg', 'r_plugins', 'r_plugins_version' ] - name: Install R packages from the cran sources repo, latest available version. Second try @@ -93,9 +92,8 @@ register: install_plugins_result failed_when: "install_plugins_result.rc != 0 or 'had non-zero exit status' in install_plugins_result.stderr" changed_when: "'Added' in install_plugins_result.stdout" - with_items: '{{ r_plugins_list_to_install }}' - when: - - r_plugins_install_latest_source + with_items: '( {{ r_plugins_list_to_install }} | default [] )' + when: r_plugins_install_latest_source tags: [ 'r_software', 'r_pkg', 'r_plugins' ] - name: Install R packages from github @@ -104,7 +102,7 @@ register: install_github_plugins_result failed_when: "install_github_plugins_result.rc != 0 or 'had non-zero exit status' in install_github_plugins_result.stderr" changed_when: "'Added' in install_github_plugins_result.stdout" - with_items: '{{ r_plugins_from_github }}' + with_items: '( {{ r_plugins_from_github }} | default [] )' when: r_plugins_from_github is defined tags: [ 'r_software', 'r_pkg', 'r_plugins', 'r_plugins_github' ] @@ -114,6 +112,6 @@ register: remove_plugins_result failed_when: remove_plugins_result.rc != 0 changed_when: "'Removed' in remove_plugins_result.stdout" - with_items: '{{ r_plugins_list_to_remove }}' + with_items: '( {{ r_plugins_list_to_remove }} | default [] )' when: r_plugins_list_to_remove is defined tags: [ 'r_software', 'r_pkg', 'r_plugins' ]