|
|
|
@ -19,9 +19,24 @@
|
|
|
|
|
tags: [ 'r_software', 'r_pkg', 'r_plugins', 'r_plugins_version' ]
|
|
|
|
|
|
|
|
|
|
- block:
|
|
|
|
|
- name: Add the Ubuntu PPA '{{ r_cran_ubuntu_packages_ppa }}'
|
|
|
|
|
apt_repository: repo='{{ r_cran_ubuntu_packages_ppa }}' state=present update_cache=yes
|
|
|
|
|
|
|
|
|
|
- name: Install the R plugins from the Ubuntu PPA
|
|
|
|
|
apt: pkg={{ r_cran_ubuntu_packages }} state=present cache_valid_time=3600
|
|
|
|
|
tags: [ 'r_software', 'r_pkg', 'r_plugins', 'r_deb_plugins' ]
|
|
|
|
|
|
|
|
|
|
- block:
|
|
|
|
|
- name: Install the R devtools package from CRAN
|
|
|
|
|
command: >
|
|
|
|
|
Rscript --slave --no-save --no-restore-history -e "if (! ('devtools' %in% installed.packages()[,'Package'])) { install.packages(pkgs='devtools', repos=c('https://cloud.r-project.org/')); print('Added'); } else { print('Already installed'); }"
|
|
|
|
|
register: install_devtools_result
|
|
|
|
|
failed_when: "install_devtools_result.rc != 0 or 'had non-zero exit status' in install_devtools_result.stderr"
|
|
|
|
|
changed_when: "'Added' in install_devtools_result.stdout"
|
|
|
|
|
|
|
|
|
|
- name: Install R packages from the cran sources repo or from an alternative repository, latest available version.
|
|
|
|
|
command: >
|
|
|
|
|
Rscript --slave --no-save --no-restore-history -e "if (! ('{{ item.name }}' %in% installed.packages()[,'Package'])) { install.packages(pkgs='{{ item.name }}', repos=c('{{ item.repo | default ('https://cloud.r-project.org') }}/')); print('Added'); } else { print('Already installed'); }"
|
|
|
|
|
Rscript --slave --no-save --no-restore-history -e "if (! ('{{ item.name }}' %in% installed.packages()[,'Package'])) { require(devtools); require(methods) ; install.packages(pkgs='{{ item.name }}', repos=c('{{ item.repo | default ('https://cloud.r-project.org') }}/')); print('Added'); } else { print('Already installed'); }"
|
|
|
|
|
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"
|
|
|
|
@ -35,7 +50,7 @@
|
|
|
|
|
|
|
|
|
|
- name: Install R packages from the cran sources, specific versions.
|
|
|
|
|
command: >
|
|
|
|
|
Rscript --slave --no-save --no-restore-history -e "if (! ('{{ item.name }}' %in% installed.packages()[,'Package'])) { install.packages('{{ r_source_plugins_dest_dir }}/{{ item.source }}', repos = NULL, type='source'); print('Added'); } else if (packageVersion('{{ item.name }}') != '{{ item.version }}') { install.packages('{{ r_source_plugins_dest_dir }}/{{ item.source }}', repos = NULL, type='source'); print('Added'); } else { print('Already Installed'); }"
|
|
|
|
|
Rscript --slave --no-save --no-restore-history -e "if (! ('{{ item.name }}' %in% installed.packages()[,'Package'])) { install.packages('{{ r_source_plugins_dest_dir }}/{{ item.source }}', repos = NULL, type='source'); print('Added'); } else if (packageVersion('{{ item.name }}') != '{{ item.version }}') { require(devtools); require(methods) ; install.packages('{{ r_source_plugins_dest_dir }}/{{ item.source }}', repos = NULL, type='source'); print('Added'); } else { print('Already Installed'); }"
|
|
|
|
|
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'
|
|
|
|
@ -62,5 +77,6 @@
|
|
|
|
|
with_items: '{{ r_plugins_list_to_remove | default([]) }}'
|
|
|
|
|
when: r_plugins_list_to_remove is defined
|
|
|
|
|
|
|
|
|
|
when: r_cran_install_from_sources
|
|
|
|
|
tags: [ 'r_software', 'r_pkg', 'r_plugins' ]
|
|
|
|
|
|
|
|
|
|