Jira (BOLT-1245) Bolt puppetfile install should install to "modules" by default

1 view
Skip to first unread message

Charlie Sharpsteen (JIRA)

unread,
Apr 13, 2019, 3:17:02 PM4/13/19
to puppe...@googlegroups.com
Charlie Sharpsteen updated an issue
 
Puppet Task Runner / Bug BOLT-1245
Bolt puppetfile install should install to "modules" by default
Change By: Charlie Sharpsteen
Summary: Bolt puppetfile install should always install to "modules" by default
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Charlie Sharpsteen (JIRA)

unread,
Apr 13, 2019, 3:19:04 PM4/13/19
to puppe...@googlegroups.com

Charlie Sharpsteen (JIRA)

unread,
Apr 13, 2019, 3:19:04 PM4/13/19
to puppe...@googlegroups.com
Charlie Sharpsteen updated an issue
Currently, the {{bolt puppetfile install}} command will install to the first location on the modulepath :

  https://github
. com/puppetlabs/bolt/blob/1.16.0/lib/bolt/cli.rb#L416

The install action removes any content not listed in the Puppetfile and reverts any changes made to modules. We should not assume that the entry placed first in the path is the location that a user wants this sort of aggressive cleaning to occur.

Historically, {{r10k puppetfile install}} has defaulted to using a directory named {{modules}}. Also, historically, control repos have been configured to priortizie {{site}} modules by placing them ahead of the {{modules}} directory on the path:

  https://github.com/puppetlabs/control-repo/blob/1.0.0/environment.conf#L1

Users following these historical patterns will find that {{bolt puppetfile install}} destroys content in the {{site}} directory.

Charlie Sharpsteen (JIRA)

unread,
Apr 13, 2019, 3:22:02 PM4/13/19
to puppe...@googlegroups.com
Charlie Sharpsteen updated an issue
Currently, the {{bolt puppetfile install}} command will install to the first location on the modulepath:

  https://github.com/puppetlabs/bolt/blob/1.16.0/lib/bolt/cli.rb#L416

The install action removes any content not listed in the Puppetfile and reverts any changes made to modules. We should not assume that the entry placed first in the path is the location that a user wants this sort of aggressive cleaning to occur.

Historically, {{r10k puppetfile install}} has defaulted to using a directory named {{modules}} :

  https://github
. com/puppetlabs/r10k/blob/3.1.1/lib/r10k/puppetfile.rb#L48

Also, historically, control repos have been configured to priortizie {{site}} modules by placing them ahead of the {{modules}} directory on the path:

  https://github.com/puppetlabs/control-repo/blob/1.0.0/environment.conf#L1

Users following these historical patterns will find that end up loosing work when {{bolt puppetfile install}} destroys content in cleans the {{site}} directory.

Nick Walker (JIRA)

unread,
Apr 24, 2019, 3:25:03 PM4/24/19
to puppe...@googlegroups.com

Alex Dreyer (JIRA)

unread,
Apr 24, 2019, 3:39:03 PM4/24/19
to puppe...@googlegroups.com
Alex Dreyer commented on Bug BOLT-1245
 
Re: Bolt puppetfile install should install to "modules" by default

I don't see a way to make this change that isn't breaking.

Adam Buxton (JIRA)

unread,
Apr 25, 2019, 9:46:02 AM4/25/19
to puppe...@googlegroups.com
Adam Buxton commented on Bug BOLT-1245

The only way I see this could work is to insist that `~/.puppetlabs/modules` is used by default, and check for its existence and then prompt $USER to use it/create it. This could work in conjunction with a new config point that defines whether to use the `user modulepath` or the `bolt modulepath`. 
I'm using the process with the customer and defaulting  

the above would work better is Puppet still defaulted to `$USERHOME/.puppetlabs/modules` when run as none root user. (but thats a by the by) 

 

Nick Walker (JIRA)

unread,
Apr 25, 2019, 1:04:03 PM4/25/19
to puppe...@googlegroups.com
Nick Walker commented on Bug BOLT-1245

Alex Dreyer Can we get a new config option to bolt something like `puppetfile_install_path` ( or I think r10k calls it moduledir) which defaults to the first item in the modulepath but can be overridden? 

Then in 2.0 we could make the breaking change so that it defaults to modules instead of the first item. 

I also like Nick Lewis suggestion to check to see if there's something in the directory r10k is going to deploy to and fail if it wasn't previously deployed by r10k and require user interaction. 

Reid Vandewiele (JIRA)

unread,
Apr 25, 2019, 1:08:02 PM4/25/19
to puppe...@googlegroups.com

`bolt puppetfile install` is technically an R10K command. There's no reason r10k has to use the same modulepath for provisioning as Bolt does for loading.

+1 to the idea Nick Walker gives above. Separate config item. Default it to modules.

Alex Dreyer (JIRA)

unread,
Apr 25, 2019, 1:12:02 PM4/25/19
to puppe...@googlegroups.com
Alex Dreyer commented on Bug BOLT-1245

I'm ok with adding the option. Officially it will have have to have no default in the 1.x series and get a default of `modules` in 2.0 to avoid making dependencies between config options.

Reid Vandewiele (JIRA)

unread,
Apr 25, 2019, 1:19:02 PM4/25/19
to puppe...@googlegroups.com
Reid Vandewiele updated an issue
 
Change By: Reid Vandewiele
Currently, the {{bolt puppetfile install}} command will install to the first location on the modulepath:

[   https://github.com/puppetlabs/bolt/blob/1.16.0/lib/bolt/cli.rb#L416 ]

The install action removes any content not listed in the Puppetfile and reverts any changes made to modules. We should not assume that the entry placed first in the path is the location that a user wants this sort of aggressive cleaning to occur.

Historically, {{r10k puppetfile install}} has defaulted to using a directory named {{modules}}:


Also, historically, control repos have been configured to priortizie {{site}} modules by placing them ahead of the {{modules}} directory on the path:

[   https://github.com/puppetlabs/control-repo/blob/1.0.0/environment.conf#L1 ]

Users following these historical patterns will end up loosing work when {{bolt puppetfile install}} cleans the {{site}} directory.


_Clarity note: the control-repo template uses {{site-modules}} instead of {{site}} starting with 1.1.0. Many users will have the older {{site}} directory still though, so it is not inappropriate to describe this issue using that name._

Reid Vandewiele (JIRA)

unread,
Apr 25, 2019, 1:20:03 PM4/25/19
to puppe...@googlegroups.com
_Clarity note: the control-repo template uses {{site-modules}} instead of {{site}} starting with 1.1.0. Many users will have the older {{site}} directory still though, so it is not inappropriate to describe this issue using that name. The issue applies regardless of what directory name is used for control-repo embedded module content. _

Reid Vandewiele (JIRA)

unread,
Apr 25, 2019, 1:46:03 PM4/25/19
to puppe...@googlegroups.com
Reid Vandewiele commented on Bug BOLT-1245
 
Re: Bolt puppetfile install should install to "modules" by default

UX note: it looks like most configuration options for bolt.yaml use a hyphen "-" character for separating words in multi-word configuration setting names; not underscores "_".

Besides being consistent with existing config options, use of a hyphen as a word-separator is aligned with newer command-line flags in Puppet, most regex implementations ideas of what is part of a word vs. characters that can separate words, as well as the general nogui pattern guidance which seems to be "use hyphens as a word separators, NOT underscores, except when there's a technical constraint that dictates otherwise."

Admittedly the nogui guidance is focused on things like command-line flags, but I think it applies well to config files as well.

Whatever configuration setting we use should use hyphens as word separators, not underscores.

If we stick with Nick's original setting name, the setting name would therefore become puppetfile-install-path.

Curious though... is this really a "breaking" change, or did we incorrectly implement this? Reading the r10k docs, it sounds like r10k always defaults to "modules", regardless of Puppet's modulepath setting. Is that right?

The Puppetfile is documented to support a "moduledir" setting. If we create a bolt.yaml setting for this then, maybe it should just be called puppetfile-moduledir.

https://github.com/puppetlabs/r10k/blob/master/doc/puppetfile.mkd#moduledir

Jarret Lavallee (JIRA)

unread,
May 9, 2019, 7:42:04 PM5/9/19
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages