102 lines
2.9 KiB
YAML
102 lines
2.9 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: Install the CRAN main R repository key
|
|
apt_key:
|
|
keyserver: 'keyserver.ubuntu.com'
|
|
id: '{{ r_cran_ubuntu_repo_key }}'
|
|
|
|
- name: Install the CRAN main R repository
|
|
apt_repository:
|
|
repo: '{{ r_cran_ubuntu_repo }}'
|
|
state: present
|
|
update_cache: yes
|
|
|
|
- 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 repositores
|
|
apt_repository:
|
|
repo: '{{ r_cran_ubuntu_packages_ppa }}'
|
|
state: absent
|
|
update_cache: yes
|
|
|
|
- name: Remove the CRAN main repository
|
|
apt_repository:
|
|
repo: '{{ r_cran_ubuntu_repo }}'
|
|
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' ]
|