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

add an option to block a module #50

Open vchepkov opened 7 years ago

vchepkov commented 7 years ago

It would be convenient if there was some option to blacklist a module or freeze module to a certain version.

For instance, if you have only Redhat based servers, there is no reason to install puppetlabs/apt or gentoo/portage. 'freeze' a version also can be handy, for example, keep puppetlabs/firewall at version 1.8.1, since 1.8.2 doesn't properly handle IPv6.

rnelson0 commented 7 years ago

Can you describe how you would imagine implementing such configuration options? What you'd expect a config file might look like, for instance.

vchepkov commented 7 years ago

What if there was a configuration file Puppetfile.gen, for example:

mod 'puppetlabs/firewall', '1.8.1'
mod 'puppetlabs/apt', '0'
mod 'gentoo/portage', '0'
rnelson0 commented 7 years ago

What about a YAML config? (parsing freeform text just seems fragile)

---
freeze:
  puppetlabs/firewall: '1.8.1'
ignore:
- puppetlabs/apt
vchepkov commented 7 years ago

Even better

earsdown commented 6 years ago

How about command line options? For example:

-r/--raw firewall -x/--exclude apt

Where raw modules are left as-is (e.g. as per input Puppetfile) and excluded modules are never included in the output Puppetfile. Specify option multiple times for multiple modules.

This approach would mean we won't need to invent and deal with another file format.

vchepkov commented 6 years ago

I suppose a script with very long command line can be used instead of config file, but it's less convenient and you are subject of ARG_MAX limitations, albeit lengthy

rnelson0 commented 4 years ago

Changed the title to use better terminology.