Skip to content
This repository was archived by the owner on Aug 29, 2018. It is now read-only.

Use secretbox to store randomly generated passwords #354

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sdodson
Copy link
Member

@sdodson sdodson commented Nov 19, 2014

Secretbox is a function that generates a random password on first call
and then retrieves those values for subsequent calls. This works in
both master and masterless environments.

See: https://forge.puppetlabs.com/sdodson/secretbox

@sdodson
Copy link
Member Author

sdodson commented Nov 19, 2014

This should prevent activemq and broker from being restarted on each puppet run if someone doesn't specify passwords for these randomly generated passwords. Users should still set common values in multihost environments.

@ekohl
Copy link

ekohl commented Nov 20, 2014

@ekohl
Copy link

ekohl commented Nov 20, 2014

In case it's unclear, 👍 from me.

@sdodson
Copy link
Member Author

sdodson commented Nov 20, 2014

Hmm, perhaps we should petition puppetlabs to add that to stdlib, that function seems really useful and more general than secretbox.

@ekohl
Copy link

ekohl commented Nov 20, 2014

@sdodson I did talk about that other foreman devs but since it stores data on the puppet master it's not compatible with a puppet multi master solution. I do agree such a function would be very good to have in stdlib.

@sdodson sdodson force-pushed the use_secretbox branch 2 times, most recently from ca78da0 to 6b65fb1 Compare November 24, 2014 15:25
@sdodson
Copy link
Member Author

sdodson commented Nov 24, 2014

[test] then we'll merge

@openshift-bot
Copy link

Origin Test Results: FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests/3166/)

@detiber
Copy link

detiber commented Nov 24, 2014

Is this the same issue you were seeing previously where it was pulling the module info from puppet forge instead of the Modulefile and/or metadata.json?

I have a PR outstanding to update the vagrant-openshift plugin (openshift/vagrant-openshift#171) to use the latest puppet from puppetlabs instead of using the one from epel, so maybe that would resolve this issue as well.

@ekohl
Copy link

ekohl commented Nov 24, 2014

@detiber no, as far as I understand it this will make the module (more) usable on continious puppet runs. Currently every puppet run will change the password to a new random string. By storing the result any subsequent run will use the same random password, if that makes sense.

@sdodson
Copy link
Member Author

sdodson commented Nov 24, 2014

@detiber Yeah looks like installing a local module on puppet 2.7.5 goes to the forge to resolve dependencies. This may be fixed in puppet 3.0.0 or possible 3.4.0.

@sdodson
Copy link
Member Author

sdodson commented Nov 24, 2014

@ekohl I think he was referring to the test run failure which is because it didn't install sdodson/secretbox

Preparing to uninstall 'openshift-openshift_origin' ...
Error: Could not uninstall module 'openshift-openshift_origin'
  Module 'openshift-openshift_origin' is not installed
Preparing to install into /etc/puppet/modules ...
Downloading from http://forge.puppetlabs.com ...
Installing -- do not interrupt ...
/etc/puppet/modules
└─┬ openshift-openshift_origin (v4.1.1)
  ├─┬ arioch-keepalived (v1.0.2)
  │ └── puppetlabs-concat (v1.1.2)
  ├── blentz-selinux_types (v0.1.0)
  ├── duritong-sysctl (v0.0.4)
  ├── puppetlabs-haproxy (v1.1.0)
  ├── puppetlabs-ntp (v3.3.0)
  ├── puppetlabs-stdlib (v4.4.0)
  └── rharrison-lokkit (v0.5.0)
Applying openshift puppet recipe
info: Loading facts in /etc/puppet/modules/concat/lib/facter/concat_basedir.rb
info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/pe_version.rb
info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb
info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb
info: Loading facts in /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb
Unknown function secretbox at /etc/puppet/modules/openshift_origin/manifests/init.pp:818 on node openshift.ec2.internal

@sdodson
Copy link
Member Author

sdodson commented Nov 24, 2014

I've tested building and installing with everything up through 3.7.3 and all versions call out to the Forge to get the list of dependencies rather than inspecting what's in the tarball. I'll check puppet jira after lunch for relevant issues.

@sdodson
Copy link
Member Author

sdodson commented Nov 24, 2014

Ok, my testing was bad the first time around. Using puppet 3.6.0 I can build and install from a tarball that has dependencies that aren't in the latest version published to forge.

https://tickets.puppetlabs.com/browse/PUP-1130 deals with this and I'm not sure all the other issues folks have run into in that ticket are resolved, but at least the one we're facing seems to be.

@detiber
Copy link

detiber commented Nov 27, 2014

Definitely going to need to build a new ami for origin... @sdodson if you hit me up on Monday I can walk you through it.

Secretbox is a function that generates a random password on first call
and then retrieves those values for subsequent calls. This works in
both master and masterless environments.

See: https://forge.puppetlabs.com/sdodson/secretbox
@openshift-bot
Copy link

Evaluated for origin up to 3fb5fac

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants