ansible-role-R/tasks/r-installation-deb.yml

85 lines
2.5 KiB
YAML

---
- block:
- name: Add the CRAN repository (Ubuntu Trusty PPA)
apt_repository:
repo: '{{ r_cran_ubuntu_packages_ppa_trusty }}'
state: present
update_cache: yes
- name: Install some additional repositories. They provide dependencies for some R packages. Ubuntu Bionic
apt_repository:
repo: '{{ item }}'
state: present
update_cache: yes
loop: '{{ r_apt_additional_repos_trusty }}'
when:
- r_install_cran_repo
- ansible_distribution_version is version_compare('14.04', '==')
tags: [ 'r_software', 'r_repo' ]
- block:
- name: Add the CRAN repository (Ubuntu Bionic PPA)
apt_repository:
repo: '{{ r_cran_ubuntu_packages_ppa }}'
state: present
update_cache: yes
- name: Install some additional repositories. They provide dependencies for some R packages. Ubuntu Bionic
apt_repository:
repo: '{{ item }}'
state: present
update_cache: yes
loop: '{{ r_apt_additional_repos }}'
when:
- r_install_cran_repo
- ansible_distribution_version is version_compare('18.04', '>=')
tags: [ 'r_software', 'r_repo' ]
- block:
- name: Remove the CRAN repository
apt_repository:
repo: '{{ r_cran_ubuntu_packages_ppa }}'
state: absent
update_cache: yes
when: not r_install_cran_repo
tags: [ 'r_software', 'r_repo' ]
- block:
- name: Remove the hold state from the debian R packages
shell: apt-mark unhold {{ item }}
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' ]
- name: Install the R base packages.
apt:
pkg: '{{ r_base_packages_list }}'
state: '{{ r_packages_main_state }}'
cache_valid_time: 3600
- name: When we install specific R deb packages, put them on hold
shell: apt-mark hold {{ item }}
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: '{{ r_plugins_packages_list }}'
state: '{{ r_packages_state }}'
cache_valid_time: 3600
- name: Install some packages needed by R packages when installed from source
apt:
pkg: '{{ r_distribution_required_packages }}'
state: '{{ r_packages_state }}'
cache_valid_time: 3600
tags: [ 'r_software', 'r_pkg', 'r_deps' ]
tags: [ 'r_software', 'r_pkg' ]