Skip to content

Commit

Permalink
Merge pull request #37 from Appsilon/feat/jupyter-vs-code
Browse files Browse the repository at this point in the history
feat: add option to set custom jupyter and vscode conf
  • Loading branch information
koralowiec authored Mar 27, 2024
2 parents 95db804 + 0ab4b0d commit bb2240b
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
19 changes: 19 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,22 @@ rstudio_workbench_sssd_install: false
# rstudio_workbench_repos_config:
# CRAN: "https://example.com/cran/__linux__/focal/latest"
# Internal: "https://example.com/internal-git/latest"

############################################################
# /etc/rstudio/vscode.conf
############################################################

# rstudio_workbench_vscode_config:
# enabled: "1"
# exe: "/usr/lib/rstudio-server/bin/code-server/bin/code-server"
# args: "--host=0.0.0.0"

############################################################
# /etc/rstudio/jupyter.conf
############################################################

# rstudio_workbench_jupyter_config:
# jupyter-exe: "/usr/local/bin/jupyter"
# notebooks-enabled: "1"
# labs-enabled: "1"
# session-cull-minutes: "0"
20 changes: 20 additions & 0 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,26 @@
when:
- rstudio_workbench_repos_config is defined

- name: Configure | create (vscode.conf) file
ansible.builtin.template:
src: etc/rstudio/vscode.conf.j2
dest: /etc/rstudio/vscode.conf
owner: root
group: root
mode: 0644
when:
- rstudio_workbench_vscode_config is defined

- name: Configure | create (jupyter.conf) file
ansible.builtin.template:
src: etc/rstudio/jupyter.conf.j2
dest: /etc/rstudio/jupyter.conf
owner: root
group: root
mode: 0644
when:
- rstudio_workbench_jupyter_config is defined

- name: Configure | license activation (offline)
notify: Restart rstudio-workbench
when: rstudio_workbench_license_offline_key_b64_encoded | d()
Expand Down
6 changes: 6 additions & 0 deletions templates/etc/rstudio/jupyter.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{ ansible_managed | comment }}

{% if rstudio_workbench_jupyter_config is defined %}
{% from "macros/ini_encode_macro.j2" import ini_encode with context -%}
{{ ini_encode(rstudio_workbench_jupyter_config) }}
{% endif %}
6 changes: 6 additions & 0 deletions templates/etc/rstudio/vscode.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{ ansible_managed | comment }}

{% if rstudio_workbench_vscode_config is defined %}
{% from "macros/ini_encode_macro.j2" import ini_encode with context -%}
{{ ini_encode(rstudio_workbench_vscode_config) }}
{% endif %}

0 comments on commit bb2240b

Please sign in to comment.