From 59f66a67c5bb897bbffbb5ee6510b502100c7a12 Mon Sep 17 00:00:00 2001 From: Trey Dockendorf Date: Fri, 5 Jun 2026 11:16:51 -0400 Subject: [PATCH] Allow using git repo for ondemand.d files --- manifests/config.pp | 14 ++++++++++++++ manifests/init.pp | 17 +++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/manifests/config.pp b/manifests/config.pp index b5a01b3..f03cfb5 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -121,6 +121,7 @@ owner => 'root', group => 'root', mode => '0755', + source => $openondemand::_ondemand_confs_source, recurse => $openondemand::config_dir_purge, force => $openondemand::config_dir_purge, purge => $openondemand::config_dir_purge, @@ -148,6 +149,19 @@ } } + if $openondemand::ondemand_confs_repo { + vcsrepo { '/opt/ood-ondemand-confs': + ensure => 'latest', + provider => 'git', + source => $openondemand::ondemand_confs_repo, + revision => $openondemand::ondemand_confs_revision, + user => 'root', + before => [ + File['/etc/ood/config/ondemand.d'], + ], + } + } + if $openondemand::apps_config_repo { vcsrepo { '/opt/ood-apps-config': ensure => 'latest', diff --git a/manifests/init.pp b/manifests/init.pp index 4c3878f..d18f39f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -233,6 +233,12 @@ # Path in apps config Git repo for locales configs # @param announcements_config_repo_path # Path in apps config Git repo for announcements +# @param ondemand_confs_repo +# Git repo URL for ondemand.d configs +# @param ondemand_confs_revision +# Revision for ondemand.d config Git repo +# @param ondemand_confs_repo_path +# Path in ondemand.d config Git repo for configs # @param apps_config_source # Source for apps config, not used if `apps_config_repo` is defined # @param locales_config_source @@ -392,6 +398,11 @@ Optional[String] $locales_config_repo_path = undef, Optional[String] $announcements_config_repo_path = undef, + # ondemand.d configs + Optional[String] $ondemand_confs_repo = undef, + Optional[String] $ondemand_confs_revision = undef, + String $ondemand_confs_repo_path = '', # lint:ignore:params_empty_string_assignment + Optional[String] $apps_config_source = undef, Optional[String] $locales_config_source = undef, Optional[String] $announcements_config_source = undef, @@ -515,6 +526,12 @@ $_apps_config_source = $apps_config_source } + if $ondemand_confs_repo and $ondemand_confs_repo_path { + $_ondemand_confs_source = "/opt/ood-ondemand-confs/${ondemand_confs_repo_path}" + } else { + $_ondemand_confs_source = undef + } + if $apps_config_repo and $locales_config_repo_path { $_locales_config_source = "/opt/ood-apps-config/${locales_config_repo_path}" } else {