This repository has been archived by the owner on Jul 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 27
Allow user/pass to be managed outside Puppet #67
Merged
bastelfreak
merged 1 commit into
voxpupuli:master
from
Slashbunny:patch-password-optional
Nov 13, 2017
Merged
Allow user/pass to be managed outside Puppet #67
bastelfreak
merged 1 commit into
voxpupuli:master
from
Slashbunny:patch-password-optional
Nov 13, 2017
Conversation
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
The change makes sense to me but the tests are failing. Could you have a look? |
The "value" field in ini_setting is optional. If it's undefined, it will ensure the setting is there, but not modify the value. The benefit to this type of behavior is that I can ensure there is a "password =" line in the configuration, but allow the user to manually set it outside of Puppet. Future Puppet runs will not modify the user-entered value. With the default being a blank string, Puppet will wipe out the user's changes every time Puppet runs.
Slashbunny
force-pushed
the
patch-password-optional
branch
from
September 15, 2017 13:15
c887464
to
0bea859
Compare
@ekohl Thanks, I corrected the failing tests. |
Tests are passing, so the label can be removed now. |
ekohl
approved these changes
Oct 9, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, looks like I missed the notification. This makes sense to me.
bastelfreak
reviewed
Nov 13, 2017
@@ -53,8 +53,8 @@ | |||
class jenkins_job_builder( | |||
$version = $jenkins_job_builder::params::version, | |||
Hash $jobs = $jenkins_job_builder::params::jobs, | |||
String $user = $jenkins_job_builder::params::user, | |||
String $password = $jenkins_job_builder::params::password, | |||
Optional[String] $user = $jenkins_job_builder::params::user, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Datatypes \o/
bastelfreak
reviewed
Nov 13, 2017
@@ -10,8 +10,8 @@ | |||
class jenkins_job_builder::params { | |||
|
|||
$jobs = {} | |||
$user = '' | |||
$password = '' | |||
$user = undef |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undef pattern \o/
Thanks for this PR @Slashbunny ! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
value
field inini_setting
is optional. If it's undefined, it will ensure the setting is there, but not modify the value. The benefit to this type of behavior is that I can ensure there is apassword =
linein the configuration, but allow the user to manually set it outside of Puppet. Future Puppet runs will not modify the user-entered value.
With the default being a blank string, Puppet will wipe out the user's changes every time Puppet runs.
Basically, this allows us to not have to deal with secrets such as the user's API key from within Puppet.
Another use case is if I am building an image for a developer to use- I may not know the username of the future developer, either, but I would still like to set everything else up so it's ready to use after filling in the username and password.