(PUP-8632) device --apply works without a cert#6863
Conversation
|
@joshcooper Thanks for the last merge, i need some feedback on this PR. When writing the logs/reports for the first time (specifically when creating the folders), it would fail. This PR makes the directory creation like "mkdir -p". |
|
CLA signed by all contributors. |
|
I'd rather not change uniquefile to create parent directories. I would think the device application just needs to call |
|
@joshcooper No worries, i have changed the approach so there is less impact outside of device. |
|
@joshcooper can you have another look please. |
|
Sorry was out on PTO. I don't have an opinion on the changes, but it'd be good to have a test. |
puppet device --apply, now works without having to register it with a puppet master.
|
Hope you had a good break @joshcooper . I added tests around the logic. @DavidS can you merge |
DavidS
left a comment
There was a problem hiding this comment.
I've tested this on my local testcase, and puppet device --apply ... did work on an empty ~/.puppetlabs:
david@davids:~/git/puppetlabs-panos$ rm -Rf ~/.puppet*
david@davids:~/git/puppetlabs-panos$ bundle exec puppet device --modulepath spec/fixtures/modules/ --deviceconfig spec/fixtures/device.conf --target pavm --verbose --trace --apply examples/test_commit.pp
Notice: Compiled catalog for pavm in environment production in 0.08 seconds
Info: Applying configuration version '1530189079'
[...]
Info: Creating state file /home/david/.puppetlabs/opt/puppet/cache/devices/pavm/state/state.yaml
Notice: Applied catalog in 0.17 seconds
david@davids:~/git/puppetlabs-panos$ find ~/.puppetlabs/
/home/david/.puppetlabs/
/home/david/.puppetlabs/etc
/home/david/.puppetlabs/etc/puppet
/home/david/.puppetlabs/etc/puppet/ssl
/home/david/.puppetlabs/etc/puppet/ssl/certificate_requests
/home/david/.puppetlabs/etc/puppet/ssl/private_keys
/home/david/.puppetlabs/etc/puppet/ssl/public_keys
/home/david/.puppetlabs/etc/puppet/ssl/private
/home/david/.puppetlabs/etc/puppet/ssl/certs
/home/david/.puppetlabs/etc/code
/home/david/.puppetlabs/opt
/home/david/.puppetlabs/opt/puppet
/home/david/.puppetlabs/opt/puppet/cache
/home/david/.puppetlabs/opt/puppet/cache/state
/home/david/.puppetlabs/opt/puppet/cache/state/graphs
/home/david/.puppetlabs/opt/puppet/cache/client_data
/home/david/.puppetlabs/opt/puppet/cache/facts.d
/home/david/.puppetlabs/opt/puppet/cache/clientbucket
/home/david/.puppetlabs/opt/puppet/cache/preview
/home/david/.puppetlabs/opt/puppet/cache/lib
/home/david/.puppetlabs/opt/puppet/cache/locales
/home/david/.puppetlabs/opt/puppet/cache/devices
/home/david/.puppetlabs/opt/puppet/cache/devices/pavm
/home/david/.puppetlabs/opt/puppet/cache/devices/pavm/state
/home/david/.puppetlabs/opt/puppet/cache/devices/pavm/state/transactionstore.yaml
/home/david/.puppetlabs/opt/puppet/cache/devices/pavm/state/last_run_report.yaml
/home/david/.puppetlabs/opt/puppet/cache/devices/pavm/state/state.yaml
/home/david/.puppetlabs/opt/puppet/cache/devices/pavm/state/last_run_summary.yaml
/home/david/.puppetlabs/opt/puppet/cache/client_yaml
/home/david/.puppetlabs/var
/home/david/.puppetlabs/var/log
/home/david/.puppetlabs/var/run
david@davids:~/git/puppetlabs-panos$
puppet device --apply, doesnt error without having to register it with a puppet master.