--- - name: install R debian packages hosts: localhost become: yes vars: rstudio_deb_version: 2022.07.2-576 tasks: - name: add r-project repository key apt_key: keyserver: keyserver.ubuntu.com id: E298A3A825C0D65DFD57CBB651716619E084DAB9 - name: add r-project repository apt_repository: repo: 'deb https://cloud.r-project.org/bin/linux/ubuntu {{ ansible_distribution_release }}-cran40/' # slash at end! filename: 'r-project' state: present update_cache: yes register: r_project_repo - name: install R/harp debian packages apt: state: latest name: - r-base - libproj-dev - libssl-dev - libcurl4-openssl-dev - libxml2-dev - libnetcdf-dev - name: install r-studio debian package apt: deb: 'https://download1.rstudio.org/desktop/bionic/amd64/rstudio-{{ rstudio_deb_version }}-amd64.deb' - name: add R packages command: Rscript -e 'install.packages("{{ item }}")' #args: #creates: '/usr/local/lib/R/site-library/{{ item }}/index' with_items: - remotes - tidyverse - name: add harp packages command: Rscript -e 'remotes::install_github("harphub/{{ item }}")' #args: #creates: '/usr/local/lib/R/site-library/{{ item }}/index' with_items: - meteogrid - harpIO - harpPoint - harpVis - harp