rnelson0 / puppet-generate-puppetfile

Generate or update a Puppetfile for use with r10k or librarian-puppet. Optionally, create a fixtures file for rspec-puppet.
92 stars 22 forks source link

Support Puppet 6 #71

Open rnelson0 opened 5 years ago

rnelson0 commented 5 years ago

Puppet 6 moved some once-core modules to separate repos. The puppet-agent typically provides those modules and they do not need to be listed in the Puppetfile (unless specifying a different version than the agent provides) and should not be listed when there are Puppet 5 agents connecting to the master. However, they need to be in the .fixtures.yml for testing.

We need an option to create the fixtures settings for the core modules. An additional option could add/remove them to/from the Puppetfile.

We must also consider the case where the Puppetfile specifies a subset of those modules, but not all, and ensure that the resulting fixtures specifies the Puppetfile version, not the default/latest versions.

logicminds commented 3 years ago

Did you have any ideas on how you wanted to implement this?

I was thinking of adding dev_only syntax to allow us to mark a dependency as a development dependency in the Puppetfile.

mod 'puppetlabs/cron_core', dev_only: true
mod 'nwops/debug, dev_only: true, git: 'https://github.com/nwops/puppet-debug'

We could create these dev dependencies in a separate file and join them programmatically during parsing.

rnelson0 commented 3 years ago

How about test_only? Either way, I'm okay with it as long as it doesn't conflict with r10k or librarian-puppet's processing of the Puppetfile. However, I don't work on those projects so wouldn't be able to ensure they respect the settings properly in the long term (i.e. I think you could add the flag now without interruption, but r10k would still end up deploying it until r10k was patched)

logicminds commented 3 years ago

Are you suggesting we add this kind of feature to r10k, librarian too?

rnelson0 commented 3 years ago

If it goes in the Puppetfile, we'd have to get them to support the functionality, or they'd download the modules we only want to be downloaded for tests.

Other alternatives would be

I think a local yml file is the most persistent with the least amount of changes overall.

cdenneen commented 3 years ago

With puppet5 now deprecated is this even necessary? Puppet6 is the earliest version you can test. Might be useable backlog for future releases like puppet 7 or puppet 8 specifics but not sure if more important than other issues?