Welcome. This is a weird one. On the face of it we're simply adding a
relationship between this module (our own fork of the consul_template
module) and a module called `github/consul`, by making this module
require v1+ of the consul module.
Two things are unusual about this. Firstly, the source of the
`github/consul` module is actually within the puppet repo - originally
at `modules/consul` but now moved to `module_src/consul`. This module is
referenced in the puppet repo's Puppetfile only with its local path, so
that the librarian install step is able to "install" the consul module
and satisfy dependencies of anything that depends on it. All that is to
say that if you try to use this consul_template module anywhere but the
github/puppet repo, librarian isn't going to be able to satisfy the
github/consul dependency. That's not wonderful, but it's a manageable
risk given how we've forked _both_ github/consul and this
consul_template module inhouse, and we currently have only one puppet
repository.
The appropriate question to ask is _why the heck are we doing this_: Our
fork of the consul module had puppet v3 functions defined, one of which
caused errors when we tried to serve the module through a v7
puppetserver. To fix this we updated the v3 functions to be puppet v4
compatible, but in doing so hit a puppet feature where you're unable to
call v4 functions in module B from module A unless module A defines a
dependency on module B in its metadata.json. Hence, this.
This limitation was removed in puppet 5.5+ but at the moment we're
having to support puppet-agent versions 4, 5 and 7 across the fleet
while we slowly migrate everything to puppet 7. I'm hopeful that if we
successfully roll puppet 7 out we can revisit this change and our module
structure in general, and remove these unnecessary hacks.
Thanks for sticking with me this far. I've just had my second covid
vaccine so I'm feeling a little loopy.
We've adjusted our consul puppet module to conform with the puppet v4
api custom functions spec, with the side-effect that these functions are
now namespaced under the consul module.
Update the function references here to call the namespaced version of
those functions.
Cleaner to have the concat::fragment depend on something that may or may not
be there anyway and that gets away from having the file resource before a
virtual that breaks tests & doesn't work when you go to apply the catalog.
- corrections after puppet-lint syntax checker
- below messages were covered in this fix:
./manifests/watch.pp - WARNING: optional parameter listed before required parameter on line 10
./manifests/watch.pp - WARNING: optional parameter listed before required parameter on line 11
./manifests/watch.pp - WARNING: string containing only a variable on line 43
./manifests/watch.pp - ERROR: trailing whitespace found on line 38
./manifests/logrotate.pp - WARNING: unquoted file mode on line 48
modified: manifests/logrotate.pp
modified: manifests/watch.pp
The `strip` arg is not supported for `zip` files, which is the only
current distribution format for consul_template. This bug is causing
warnings during our puppet runs.