Skip to content

Commit

Permalink
more flexible ondemand.d configurations. (#258)
Browse files Browse the repository at this point in the history
more flexible ondemand.d configurations.

This allows for more flexible ondemand.d configurations. Instead of
this role supplying all configurations in one single file, users
can define a yaml structure that will create specific files for each
feature while also being able to specify group and file permissions
on the file.
  • Loading branch information
johrstrom authored Dec 11, 2024
1 parent 58b3155 commit d0972b5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions defaults/main/ondemand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,5 @@ hide_app_version: false
# google_analytics_tag_id: null

motd_render_html: false

# ood_ondemand_d_configs: {}
1 change: 1 addition & 0 deletions molecule/default/fixtures/ondemand.d/motd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
motd_render_html: true
2 changes: 2 additions & 0 deletions molecule/default/tasks/verify_custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- { src: "fixtures/apps/bc_desktop/", dest: "bc_desktop/" }
- { src: "fixtures/config/auth_openidc.conf", dest: "auth_openidc.conf" }
- { src: "fixtures/ondemand.d/ondemand_custom.yml", dest: "ondemand.yml" }
- { src: "fixtures/ondemand.d/motd.yml", dest: "motd.yml" }

- name: Verify config files
ansible.builtin.command: "diff /tmp/{{ item.left }} {{ item.right }}"
Expand All @@ -23,6 +24,7 @@
- { left: "bc_desktop/submit/submit.yml.erb", right: "{{ ood_base_conf_dir }}/apps/bc_desktop/submit/submit.yml.erb" }
- { left: "auth_openidc.conf", right: "{{ apache_conf_dir }}/auth_openidc.conf" }
- { left: "ondemand.yml", right: "{{ ood_base_conf_dir }}/ondemand.d/ondemand.yml" }
- { left: "motd.yml", right: "{{ ood_base_conf_dir }}/ondemand.d/motd.yml" }
changed_when: false

- name: Verify sys/jupyter was installed correctly
Expand Down
5 changes: 5 additions & 0 deletions molecule/default/vars/ondemand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,8 @@ globus_endpoints:
google_analytics_tag_id: 'abc123'

motd_render_html: true

ood_ondemand_d_configs:
motd:
content:
motd_render_html: true
10 changes: 10 additions & 0 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@
dest: "{{ ood_base_conf_dir }}/ondemand.d/ondemand.yml"
mode: 'u=rw,g=r,o=r'

- name: Create other ondemand.d files
copy:
content: "{{ ood_ondemand_d_configs[item].content | to_nice_yaml }}"
dest: "{{ ood_base_conf_dir }}/ondemand.d/{{ item }}.yml"
mode: "{{ ood_ondemand_d_configs[item].mode | default('644') }}"
group: "{{ ood_ondemand_d_configs[item].group | default('root') }}"
loop: "{{ ood_ondemand_d_configs | list | default([]) }}"
when: ood_ondemand_d_configs is defined


- name: Enable Debian apache mods
ansible.builtin.file:
src: "{{ apache_etc_dir }}/mods-available/{{ item }}.load"
Expand Down

0 comments on commit d0972b5

Please sign in to comment.