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

Added configuration to enable/disable maintenance with Puppet #170

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

abujeda
Copy link
Contributor

@abujeda abujeda commented Jan 9, 2025

As we manage all the OOD configuration and deployments with Puppet, we would like to enable/disable maintenance mode using a Puppet deployment.

This PR adds a new file resource to manage the maintenace.enable file.
I am using undef to make it backwards compatible with institutions managing this file manually.

Comment on lines 97 to 102
if $openondemand::maintenance_enabled != undef {
if $openondemand::maintenance_enabled {
$maintenance_enable_ensure = 'file'
} else {
$maintenance_enable_ensure = 'absent'
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if $openondemand::maintenance_enabled != undef {
if $openondemand::maintenance_enabled {
$maintenance_enable_ensure = 'file'
} else {
$maintenance_enable_ensure = 'absent'
}
if $openondemand::maintenance_enabled {
$maintenance_enable_ensure = 'file'
} else {
$maintenance_enable_ensure = 'absent'
}

If it goes from enabled=true to undef the file won't get removed, so probably better to that undef or false will remove the file and true will create the file.

Copy link
Contributor Author

@abujeda abujeda Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I have updated.

I did the check for undef for installations that are managing the maintenance.enable file manually and upgrading to the new puppet version will delete the file automatically if available after the upgrade.

I thought that changing from true to undef and the file not being deleted will be easier to spot and fix.

@treydock treydock added the enhancement New feature or request label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants