--- - name: r-installation-deb | Manage the CRAN PPA when: - r_install_cran_repo - ansible_distribution_version is version_compare('14.04', '==') tags: ['r_software', 'r_repo'] block: - name: r-installation-deb | Add the CRAN repository (Ubuntu Trusty PPA) ansible.builtin.apt_repository: repo: '{{ r_cran_ubuntu_packages_ppa_trusty }}' state: present update_cache: true - name: r-installation-deb | Install some additional repositories. They provide dependencies for some R packages. Ubuntu Bionic ansible.builtin.apt_repository: repo: '{{ item }}' state: present update_cache: true loop: '{{ r_apt_additional_repos_trusty }}' - name: r-installation-deb | Manage the CRAN PPA on Ubuntu >= 16.04 when: - r_install_cran_repo - ansible_distribution_version is version_compare('18.04', '>=') tags: ['r_software', 'r_repo'] block: - name: r-installation-deb | Install the CRAN main R repository key ansible.builtin.apt_key: keyserver: 'keyserver.ubuntu.com' id: '{{ r_cran_ubuntu_repo_key }}' - name: r-installation-deb | Install the CRAN main R repository ansible.builtin.apt_repository: repo: '{{ r_cran_ubuntu_repo }}' state: present update_cache: true - name: r-installation-deb | Add the CRAN repository (Ubuntu Bionic PPA) ansible.builtin.apt_repository: repo: '{{ r_cran_ubuntu_packages_ppa }}' state: present update_cache: true - name: r-installation-deb | Install some additional repositories. They provide dependencies for some R packages. Ubuntu Bionic ansible.builtin.apt_repository: repo: '{{ item }}' state: present update_cache: true loop: '{{ r_apt_additional_repos }}' - name: r-installation-deb | Remove the CRAN repo when we do not want it when: not r_install_cran_repo tags: ['r_software', 'r_repo'] block: - name: r-installation-deb | Remove the CRAN repositores ansible.builtin.apt_repository: repo: '{{ r_cran_ubuntu_packages_ppa }}' state: absent update_cache: true - name: r-installation-deb | Remove the CRAN main repository ansible.builtin.apt_repository: repo: '{{ r_cran_ubuntu_repo }}' state: absent update_cache: true - name: r-installation-deb | Install the R base packages from the repository, unversioned when: not r_base_versioned tags: ['r_software', 'r_pkg', r_unversioned_packages] block: - name: r-installation-deb | Remove the hold state from the debian R packages ansible.builtin.dpkg_selections: name: "{{ item }}" selection: install with_items: '{{ r_base_packages_hold_list | default([]) }}' tags: ['r_software', 'r_pkg', 'r_pkg_hold'] - name: r-installation-deb | Install the R base packages. ansible.builtin.apt: pkg: '{{ r_base_packages_list }}' state: present cache_valid_time: 3600 - name: r-installation-deb | Install the R base packages from the repository, versioned. Put them on hold when: r_base_versioned tags: ['r_software', 'r_pkg', r_unversioned_packages] block: - name: r-installation-deb | Install the R base packages, versioned. ansible.builtin.apt: pkg: '{{ r_base_versioned_packages_list }}' state: present cache_valid_time: 3600 - name: r-installation-deb | Put some packages into hold state ansible.builtin.dpkg_selections: name: "{{ item }}" selection: hold with_items: '{{ r_base_packages_hold_list | default([]) }}' tags: ['r_software', 'r_pkg', 'r_pkg_hold'] - name: r-installation-deb | Manage deb packages from CRAN when: r_cran_install_from_ppa tags: ['r_software', 'r_pkg', r_cran_packages] block: - name: r-installation-deb | Install some additional R modules from the CRAN deb repo ansible.builtin.apt: pkg: '{{ r_plugins_packages_list }}' state: present cache_valid_time: 3600 - name: r-installation-deb | Manage dependencies required by R packages installed from source tags: ['r_software', 'r_pkg', r_cran_dependencies] block: - name: r-installation-deb | Install some packages required by R packages when installed from source ansible.builtin.apt: pkg: '{{ r_distribution_required_packages }}' state: present cache_valid_time: 3600