Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/rspm #506

Merged
merged 8 commits into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 65 additions & 45 deletions rstudio/rstudio.yml
Original file line number Diff line number Diff line change
@@ -1,68 +1,88 @@
---
- name: PRE_TASK Update apt cache
become: true
ansible.builtin.apt:
upgrade: true
update_cache: true
autoremove: true
autoclean: true


- name: Pip
ansible.builtin.apt:
name: python3-pip
state: latest

- name: Setup password for default user
become: true
ansible.builtin.user:
name: "{{ rstudio_vars.default_user }}"
password: "{{ rstudio_vars.default_password | password_hash('sha512') }}"
update_password: always
password_lock: false
name: "{{ rstudio_vars.default_user }}"
password: "{{ rstudio_vars.default_password | password_hash('sha512') }}"
update_password: always
password_lock: false

- name: Update package index
become: true
apt:
update_cache: true
when: not rstudio_vars.create_only_backend

- name: Install apt-file
become: true
apt:
name: apt-file
state: present
when: not rstudio_vars.create_only_backend

- name: Install R role
include_role:
name: oefenweb.latest_r
name: oefenweb.latest_r
vars:
r_packages:
- name: remotes
- name: cran4linux/rspm
type: github
when: not rstudio_vars.create_only_backend

- name: Install rstudio-server role
include_role:
name: oefenweb.rstudio_server
name: oefenweb.rstudio_server
vars:
rstudio_install: [r-base]
rstudio_server_version: "{{ rstudio_vars.RSTUDIO_VERSION | replace('v', '') | replace('+', '-') }}"
rstudio_install: [r-base]
rstudio_server_version: "{{ rstudio_vars.RSTUDIO_VERSION | replace('v', '') | replace('+', '-') }}"
when: not rstudio_vars.create_only_backend

- name: Ensure .Rprofile file exists
become: true
file:
path: /home/{{ rstudio_vars.default_user }}/.Rprofile
state: touch
when: not rstudio_vars.create_only_backend
- name: Configure R profile
become: true
become_user: ubuntu
blockinfile:
path: /home/{{ rstudio_vars.default_user }}/.Rprofile
marker: "# {mark} ANSIBLE MANAGED BLOCK"
block: |
suppressMessages(rspm::enable())
when: not rstudio_vars.create_only_backend

- name: Install essential system packages
ansible.builtin.apt:
name:
- build-essential
- libcurl4-openssl-dev
- libssl-dev
- zlib1g-dev
- libpng-dev
- libjpeg-dev
- libtiff-dev
- libfreetype6-dev
- libfontconfig1-dev
- libmysqlclient-dev
- libsqlite3-dev
- libpq-dev
- libfribidi-dev
- libharfbuzz-dev
- libxml2-dev
- cmake
state: present
name:
- build-essential
- libcurl4-openssl-dev
- libssl-dev
- zlib1g-dev
- libpng-dev
- libjpeg-dev
- libtiff-dev
- libfreetype6-dev
- libfontconfig1-dev
- libmysqlclient-dev
- libsqlite3-dev
- libpq-dev
- libfribidi-dev
- libharfbuzz-dev
- libxml2-dev
- cmake
state: present
become: true

- name: Copy session file if also installing rstudio
ansible.builtin.copy:
content: session-timeout-minutes=180
dest: "{{ rstudio_vars.RSESSION_FILE_PATH }}"
mode: "0644"
owner: root
group: root
content: session-timeout-minutes=180
dest: "{{ rstudio_vars.RSESSION_FILE_PATH }}"
mode: "0644"
owner: root
group: root
when: not rstudio_vars.create_only_backend

- name: Flush rstudio handlers
Expand Down
Loading