Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Allow user/pass to be managed outside Puppet #67

Merged
merged 1 commit into from
Nov 13, 2017

Conversation

Slashbunny
Copy link
Contributor

@Slashbunny Slashbunny commented Sep 14, 2017

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.

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.

@ekohl
Copy link
Member

ekohl commented Sep 15, 2017

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
Copy link
Contributor Author

@ekohl Thanks, I corrected the failing tests.

@Slashbunny
Copy link
Contributor Author

Tests are passing, so the label can be removed now.

@ekohl ekohl removed the tests-fail label Oct 9, 2017
Copy link
Member

@ekohl ekohl left a 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.

@@ -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,
Copy link
Member

Choose a reason for hiding this comment

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

Datatypes \o/

@@ -10,8 +10,8 @@
class jenkins_job_builder::params {

$jobs = {}
$user = ''
$password = ''
$user = undef
Copy link
Member

Choose a reason for hiding this comment

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

undef pattern \o/

@bastelfreak bastelfreak added the enhancement New feature or request label Nov 13, 2017
@bastelfreak
Copy link
Member

Thanks for this PR @Slashbunny !

@bastelfreak bastelfreak merged commit d3a1113 into voxpupuli:master Nov 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants