-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for navbar customization
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# @summary Configure the navigation bar for OOD | ||
# | ||
# @param include_default | ||
# Whether to include the default navbar items. Defaults to true | ||
# | ||
# @param navbar_items | ||
# Array of items to put in the navbar (left side) | ||
# | ||
# @param helpbar_items | ||
# Array of items to put in the helpbar (right side) | ||
# | ||
class profile_ondemand::navbar ( | ||
Boolean $include_default = true, | ||
Optional[Array[Hash]] $navbar_items = undef, | ||
Optional[Array[Hash]] $helpbar_items = undef, | ||
) { | ||
if $include_default { | ||
$_content = { | ||
nav_bar => [ | ||
'apps', | ||
'files', | ||
'jobs', | ||
'clusters', | ||
'interactive apps', | ||
] + | ||
pick($navbar_items, []) | ||
+ [ | ||
'sessions', | ||
], | ||
help_bar => pick($helpbar_items, []) + [ | ||
'develop', | ||
'help', | ||
'user', | ||
'logout', | ||
], | ||
} | ||
} else { | ||
if ! $navbar_items and ! $helpbar_items { | ||
err('Open OnDemand has an empty navigation bar!') | ||
} | ||
$_content = { | ||
nav_bar => pick($navbar_items, []), | ||
help_bar => pick($helpbar_items, []), | ||
} | ||
} | ||
|
||
file { '/etc/ood/config/ondemand.d/custom-navbar.yml': | ||
ensure => 'file', | ||
mode => '0644', | ||
content => join([ | ||
'# File managed by Puppet - DO NOT EDIT', | ||
to_yaml($_content), | ||
'', | ||
], "\n"), | ||
} | ||
} |