|
| 1 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 2 | +# contributor license agreements. See the NOTICE file distributed with |
| 3 | +# this work for additional information regarding copyright ownership. |
| 4 | +# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 5 | +# (the "License"); you may not use this file except in compliance with |
| 6 | +# the License. You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | + |
| 16 | +# Install R binaries and CRAN packages |
| 17 | +--- |
| 18 | + |
| 19 | +# The Ubuntu archives on CRAN are signed with a key with ID E084DAB9. Add this key to the system. |
| 20 | +- name: repository | add public key |
| 21 | + apt_key: |
| 22 | + id: E084DAB9 |
| 23 | + keyserver: keyserver.ubuntu.com |
| 24 | + state: present |
| 25 | + |
| 26 | +# in order to get the latest version of R, add CRAN repository to the to the list of sources |
| 27 | +- name: repository | add cran-r |
| 28 | + apt_repository: |
| 29 | + repo: "{{ item.type }} {{ item.url }}" |
| 30 | + state: present |
| 31 | + update_cache: true |
| 32 | + with_items: r_repository |
| 33 | + |
| 34 | +- name: Install R. This may take a while. |
| 35 | + apt: pkg=r-base state=present |
| 36 | + |
| 37 | +- name: Install R packages required for the R interpreter. This may take a while. |
| 38 | + shell: /usr/bin/Rscript --slave --no-save --no-restore-history -e "if (! ('{{item}}' %in% installed.packages()[,'Package'])) install.packages(pkgs=c('{{item}}'), repos=c('{{r_packages_repos}}'))" |
| 39 | + with_items: |
| 40 | + - evaluate |
| 41 | + - knitr |
| 42 | + |
| 43 | +- name: Install R packages recommended for the R interpreter. |
| 44 | + shell: /usr/bin/Rscript --slave --no-save --no-restore-history -e "if (! ('{{item}}' %in% installed.packages()[,'Package'])) install.packages(pkgs=c('{{item}}'), repos=c('{{r_packages_repos}}'))" |
| 45 | + with_items: |
| 46 | + - repr |
| 47 | + - htmltools |
| 48 | + - base64enc |
| 49 | + |
| 50 | +# requirements for Plotly include libcurl and libssl |
| 51 | +- name: Install libcurl |
| 52 | + apt: pkg={{ item }} state=present |
| 53 | + with_items: |
| 54 | + - libcurl4-openssl-dev |
| 55 | + - libssl-dev |
| 56 | + |
| 57 | +- name: Install other helpful R packages |
| 58 | + shell: /usr/bin/Rscript --slave --no-save --no-restore-history -e "if (! ('{{item}}' %in% installed.packages()[,'Package'])) install.packages(pkgs=c('{{item}}'), repos=c('{{r_packages_repos}}'))" |
| 59 | + with_items: |
| 60 | + - ggplot2 |
| 61 | + - plotly |
| 62 | + |
0 commit comments