-
Notifications
You must be signed in to change notification settings - Fork 4
/
install_shiny_server.yml
59 lines (52 loc) · 1.8 KB
/
install_shiny_server.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
- name: Install and Configure Shiny Server
hosts: raspberries
become: true
vars_files:
- vars/config_vars.yml
tasks:
- name: Make sure system dependencies are installed
apt:
name:
- libcairo2-dev
- libjpeg62
- libxt-dev
- libharfbuzz-dev
- git
- cmake
- pandoc
state: present
- name: Define R package dependencies
set_fact:
shiny_dependencies: "c('Rcpp', 'later', 'fs', 'httpuv', 'mime',
'jsonlite', 'digest', 'htmltools',
'xtable', 'R6', 'Cairo', 'sourcetools', 'shiny', 'rmarkdown')"
- name: Set R package repository and site-library folder
set_fact:
cran_repo: "c('R4Pi' = 'https://pkgs.r4pi.org/{{ ansible_distribution_release }}', 'CRAN' = 'https://cran.rstudio.com/')"
package_library: >-
{%- if use_r4pi and use_rig == false -%}
'/opt/R/release/lib/R/site-library/'
{%- elif use_rig and use_r4pi == false -%}
'/opt/R/{{r_version}}/lib/R/site-library/'
{%- else -%}
'/usr/local/lib/R/site-library/'
{%- endif -%}
- name: Install R package dependencies
become_flags: 'su - -c'
shell:
cmd: "R -e \"install.packages({{ shiny_dependencies }} [!({{ shiny_dependencies }} %in% installed.packages())], repos={{ cran_repo }}, lib={{ package_library }})\""
register: r_install
changed_when: r_install.stderr != ""
- name: Install Shiny server from source
include_role:
name: install_shiny_server
apply:
tags: shiny_server
tags: shiny_server
- name: Congifure Shiny server
include_role:
name: configure_shiny_server
apply:
tags: configure_shiny
tags: configure_shiny