Jira (PUP-10720) Update `cadir` default to return the new location post-migration

27 views
Skip to first unread message

Maggie Dreyer (Jira)

unread,
Oct 15, 2020, 7:01:03 PM10/15/20
to puppe...@googlegroups.com
Maggie Dreyer created an issue
 
Puppet / Task PUP-10720
Update `cadir` default to return the new location post-migration
Issue Type: Task Task
Assignee: Unassigned
Created: 2020/10/15 4:00 PM
Priority: Normal Normal
Reporter: Maggie Dreyer

In order to make the transition to the new CA dir location as seamless as possible, we want to put some special logic into the default calculation for the cadir setting in Puppet.

If the setting is not configured by the user (default, use lambda):

  • and the files are in the old default spot, warn and prompt users to migrate. Return the old default (/etc/puppetlabs/puppet/ssl/ca)
  • and there are no CA files (new install) or CA files in the new location, return the new location (/etc/puppetlabs/puppetserver/ca).

If the setting is configured by the user (custom, use hook (example)):

  • and points to a location within the SSL dir, warn and prompt migration
  • and points to a location outside the SSL dir, use it as-is.
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Maggie Dreyer (Jira)

unread,
Oct 15, 2020, 7:02:03 PM10/15/20
to puppe...@googlegroups.com
Maggie Dreyer updated an issue
Change By: Maggie Dreyer
In order to make the transition to the new CA dir location as seamless as possible, we want to put some special logic into the default calculation for the {{cadir}} setting in Puppet , that will make it return the new location after the CA has been migrated, and warn otherwise .

If the setting is not configured by the user ([default|https://github.com/puppetlabs/puppet/blob/e0746ca619fac312b86e26b4a1f73db70b146947/lib/puppet/defaults.rb#L1094], use lambda):
* and the files are in the old default spot, warn and prompt users to migrate. Return the old default (/etc/puppetlabs/puppet/ssl/ca)
* and there are no CA files (new install) or CA files in the new location, return the new location (/etc/puppetlabs/puppetserver/ca).

If the setting is configured by the user (custom, use hook ([example)|https://github.com/puppetlabs/puppet/blob/main/lib/puppet/defaults.rb#L133]):
* and points to a location within the SSL dir, warn and prompt migration
* and points to a location _outside_ the SSL dir, use it as-is.

Josh Cooper (Jira)

unread,
Oct 16, 2020, 12:58:04 PM10/16/20
to puppe...@googlegroups.com
Josh Cooper commented on Task PUP-10720
 
Re: Update `cadir` default to return the new location post-migration

Looks great! One gotcha with hooks is 1) they may be called multiple times and 2) if the cadir setting is defined in the server section, then by default the hook will only be called if the hook is defined using :call_hook => :on_initialize_and_write. If :call_hook is unspecified, then it will default to :on_write_only, which will only call the hook if the value is set in main. I recently ran into this in PUP-9481.

Justin Stoller (Jira)

unread,
Oct 26, 2020, 6:08:03 PM10/26/20
to puppe...@googlegroups.com
Justin Stoller updated an issue
 
Change By: Justin Stoller
In order to make the transition to the new CA dir location as seamless as possible, we want to put some special logic into the default calculation for the {{cadir}} setting in Puppet, that will make it return the new location after the CA has been migrated, and warn otherwise.


If the setting is not configured by the user ([default|https://github.com/puppetlabs/puppet/blob/e0746ca619fac312b86e26b4a1f73db70b146947/lib/puppet/defaults.rb#L1094], use lambda):
* and the files are in the old default spot, warn and prompt users to migrate. Return the old default (/etc/puppetlabs/puppet/ssl/ca)
* and there are no CA files (new install) or CA files in the new location, return the new location (/etc/puppetlabs/puppetserver/ca).

If the setting is configured by the user (custom, use hook ([example)|https://github.com/puppetlabs/puppet/blob/main/lib/puppet/defaults.rb#L133]):
* and points to a location within the SSL dir, warn and prompt with a message that encourages migration

* and points to a location _outside_ the SSL dir, use it as-is.

Justin Stoller (Jira)

unread,
Oct 26, 2020, 6:10:02 PM10/26/20
to puppe...@googlegroups.com
Justin Stoller updated an issue
In order to make the transition to the new CA dir location as seamless as possible, we want to put some special logic into the default calculation for the {{cadir}} setting in Puppet, that will make it return the new location after the CA has been migrated, and warn otherwise.

If the setting is not configured by the user ([default|https://github.com/puppetlabs/puppet/blob/e0746ca619fac312b86e26b4a1f73db70b146947/lib/puppet/defaults.rb#L1094], use a Ruby lambda /proc ):
* and the files are in the old default spot, warn
and prompt with a message that encourages users to migrate. Return the old default (/etc/puppetlabs/puppet/ssl/ca)

* and there are no CA files (new install) or CA files in the new location, return the new location (/etc/puppetlabs/puppetserver/ca).

If the setting is configured by the user (custom, use hook ([example)|https://github.com/puppetlabs/puppet/blob/main/lib/puppet/defaults.rb#L133]):
* and points to a location within the SSL dir, warn with a message that encourages migration

* and points to a location _outside_ the SSL dir, use it as-is.

Justin Stoller (Jira)

unread,
Oct 26, 2020, 6:17:03 PM10/26/20
to puppe...@googlegroups.com

Justin Stoller (Jira)

unread,
Oct 26, 2020, 6:42:03 PM10/26/20
to puppe...@googlegroups.com

Tony Vu (Jira)

unread,
Oct 27, 2020, 3:55:03 PM10/27/20
to puppe...@googlegroups.com

Justin Stoller (Jira)

unread,
Nov 2, 2020, 5:43:04 PM11/2/20
to puppe...@googlegroups.com
Justin Stoller updated an issue
Change By: Justin Stoller
Sprint: Froyo 11/02/2020 , Froyo 11/09/2020

Maggie Dreyer (Jira)

unread,
Nov 3, 2020, 4:53:03 PM11/3/20
to puppe...@googlegroups.com

Tony Vu (Jira)

unread,
Nov 3, 2020, 6:35:03 PM11/3/20
to puppe...@googlegroups.com
Tony Vu updated an issue
Change By: Tony Vu
Release Notes: Deprecation
Release Notes Summary: Beginning in Puppet 7, the default value for the `cadir` setting will be located in the puppetserver conf directory, specifically at /etc/puppetlabs/puppetserver/ca. Previously, the default location was inside puppet's own ssldir. This change will make it safer to delete the puppet's own `ssldir` without accidentally deleting your CA certificates.

The puppetserver ca cli provides a `migrate` command to move the ca directory from the puppet conf to the puppetserver conf. It will leave behind a symlink on the old ca location, pointing to the new location at /etc/puppetlabs/puppetserver/ca. This link will provide backwards compatibility for tools still expecting the cadir to exist in the old location. In a future version of puppet, the cadir setting will be removed entirely.

Josh Cooper (Jira)

unread,
Nov 4, 2020, 6:39:03 PM11/4/20
to puppe...@googlegroups.com
Josh Cooper commented on Task PUP-10720
 
Re: Update `cadir` default to return the new location post-migration

Merged to main in ad5b16091d.

Passed CI in f664d6a216

Claire Cadman (Jira)

unread,
Nov 9, 2020, 6:52:03 AM11/9/20
to puppe...@googlegroups.com

Maggie Dreyer (Jira)

unread,
Nov 9, 2020, 12:22:02 PM11/9/20
to puppe...@googlegroups.com
Maggie Dreyer updated an issue
Change By: Maggie Dreyer
Release Notes: Deprecation Not Needed

Maggie Dreyer (Jira)

unread,
Nov 9, 2020, 12:22:03 PM11/9/20
to puppe...@googlegroups.com
Maggie Dreyer updated an issue
Change By: Maggie Dreyer
Release Notes Summary: Beginning in Puppet 7, the default value See SERVER-2896 for the `cadir` setting will be located in the puppetserver conf directory, specifically at /etc/puppetlabs/puppetserver/ca release notes . Previously, the default location was inside puppet's own ssldir. This change will make it safer to delete the puppet's own `ssldir` without accidentally deleting your CA certificates.


The puppetserver ca cli provides a `migrate` command to move the ca directory from the puppet conf to the puppetserver conf. It will leave behind a symlink on the old ca location, pointing to the new location at /etc/puppetlabs/puppetserver/ca. This link will provide backwards compatibility for tools still expecting the cadir to exist in the old location. In a future version of puppet, the cadir setting will be removed entirely.
Reply all
Reply to author
Forward
0 new messages