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

Extend support for additional ondemand.d configuration parameters #242

Open
mikej888 opened this issue Mar 22, 2024 · 6 comments
Open

Extend support for additional ondemand.d configuration parameters #242

mikej888 opened this issue Mar 22, 2024 · 6 comments

Comments

@mikej888
Copy link

Environment:

  • Ubuntu 22.04
  • Python 3.11.5
  • Ansible 8.0.0
  • osc.open_ondemand 3.1.4

Extend templates/ondemand.yml.j2 to support all parameters defined in ondemand.d/*.yml files

For example, for the following (which I needed in a playbook I was writing):

dashboard_header_img_logo
disable_dashboard_logo
dashboard_logo
dashboard_logo_height
dashboard_title
nav_categories
navbar_type

I currently use a local template:

{% if dashboard_header_img_logo is defined %}
dashboard_header_img_logo: {{ dashboard_header_img_logo }}
{% endif %}
{% if disable_dashboard_logo is defined %}
disable_dashboard_logo: {{ disable_dashboard_logo | bool | lower}}
{% endif %}
{% if dashboard_logo is defined %}
dashboard_logo: {{ dashboard_logo }}
{% endif %}
{% if dashboard_logo_height is defined %}
dashboard_logo_height: {{ dashboard_logo_height }}
{% endif %}
{% if dashboard_title is defined %}
dashboard_title: {{ dashboard_title }}
{% endif %}
{% if nav_categories is defined %}
nav_categories: {{ nav_categories }}
{% endif %}
{% if navbar_type is defined %}
navbar_type: {{ navbar_type }}
{% endif %}

Similarly, add example defaults to defaults/main/ondemand.yml, for example:

dashboard_header_img_logo: null
disable_dashboard_logo: false
dashboard_logo: null
dashboard_logo_height: null
dashboard_title: "Open OnDemand"
navbar_type: default
nav_categories: ['Apps', 'Files', 'Jobs', 'Clusters', 'Interactive Apps']

Other, currently unsupported, parameters from ondemand.d/*.yml files include

brand_bg_color: null
brand_link_active_bg_color: null
profile_links: []
custom_css_files: []
custom_javascript_files: []
show_all_apps_link: false
nav_bar: []
help_bar: []
interactive_apps_menu: {}
custom_pages: {}
navbar_type: dark
public_url: "/public"
announcement_path:
  - "/etc/ood/config/announcement.md"
  - "/etc/ood/config/announcement.yml"
  - "/etc/ood/config/announcements.d"
@johrstrom
Copy link
Collaborator

Yea honestly, this role should just parrot what the puppet module does which is basically just copy YAML. That way, we don't have to keep up with upstream config options - folks can just supply the YAML they want to write and we write it.

@johrstrom
Copy link
Collaborator

I'm contemplating other breaking changes in the upcoming release like #238 so maybe in the next release we'll change this too. I kinda hate to do it because it'll be super painful for users, but in the long run it'll be a better for users of this role.

@mikej888
Copy link
Author

@johrstrom, thanks. I'd agree that allowing users to specify whatever YAML they want would be easier for you to maintain. It's also consistent with what users have to do when providing dex configuration anyway so I wouldn't think it would challenge from that perspective.

As for breaking changes in the next release, perhaps support both approaches (without adding any more parameters to your current template) with a heads-up to users that the individual parameters are deprecated and you'll drop support for those in the next again release?

PS I'm finding your Ansible role very useful. It's also written in such a way that any limitations I've found (as reported in other issues today!) are straightforward to workaround at the playbook level! Thanks for developing it!

@johrstrom
Copy link
Collaborator

As for breaking changes in the next release, perhaps support both approaches

Thanks, that's a great idea and one I'll likely do. I can likely even patch that for this release so folks can start using the new approach now.

@mikej888
Copy link
Author

I just noticed that my issue essentially duplicates 'templates/ondemand.yml.j2 not updated with OOD v3.0 options?' #224 (I think the terms I'd used to search the issue tracker before raising this issue weren't fine tuned enough)

@johrstrom
Copy link
Collaborator

🤦‍♂️ yep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants