puppetlabs / pdksync

Manage large sets of modules with automation built on top of PDK
Apache License 2.0
13 stars 29 forks source link

Allow management of arbitrary files like modulesync does #115

Open genebean opened 5 years ago

genebean commented 5 years ago

PDKSync should allow for this as it is a function of modulesync that I no longer have access to due to the PDK also using a file names .sync.yaml for its configuration.

I use this functionality to maintain a templetized version of files not edited by the PDK.

Sent with GitHawk

genebean commented 5 years ago

The specific use cases I have are:

Sent with GitHawk

nmaludy commented 4 years ago

+1 we need this too

DavidS commented 4 years ago

When we set out to build the pdk-templates, the thought was that folks with additional needs like this will fork pdk-templates, add their additionally required files and defaults, and regularly pull in from pdk-templates#master (or whatever tag matching their PDK version they're running).

Would this work for you?

genebean commented 4 years ago

When we set out to build the pdk-templates, the thought was that folks with additional needs like this will fork pdk-templates, add their additionally required files and defaults, and regularly pull in from pdk-templates#master (or whatever tag matching their PDK version they're running).

Would this work for you?

IMO, no. I don't want to add work to my plate by having to manually track changes in pdk-templates. My goal is not to diverge from the templates provided by Puppet but rather supplement them. In the scenario described in this issue I would not have to spend cycles tracking upstream changes, I'd just have to keep my site-specific data up-to-date. Generally speaking, the PDK and its associated templates are updated much more often than my site-specific data / configs / files.

cdenneen commented 3 years ago

@DavidS This is something I basically discussed back in 2018 with @bmjen and the preference I believe would be to allow for a similar config_defaults.yml which in turn would allow for these changes to be placed into the managed modules... and then if you needed to override from there an individual one off module could have a .sync.yml to override that single behavior...

so for example you could set in the config_defaults.yml that in spec/spec_helper.rb you wanted minimum_coverage of 95 but there is one module you know won't meet that so you'd either nil it in that single modules .sync.yml or change it to a value you know would pass... similarly with other settings that get applied down...

So its' like pdk-templates has it's defaults... the pdksync has defaults override those... and then the module has .sync.yml to be the final override.

genebean commented 3 years ago

The overwhelming desire for this has resurfaced for me too as I have started another round of work on modules

logicminds commented 3 years ago

I was also wanting this. Ended up putting this in my CI file. This will find all directories and put files using cp or rsync


# pre setup and command
mkdir managed_files
# files you want to managed
cp .gitlab-ci.yml managed_files/
cp .sync managed_files/
# -r copies the directory, so specifying hidden and normal files here
find modules_pdksync -mindepth 1 -maxdepth 1 -type d -exec cp -v managed_files/.* {}/ \;`
find modules_pdksync -mindepth 1 -maxdepth 1 -type d -exec cp -v managed_files/* {}/ \;`

or

# haven't actually tried this but it should work
find modules -mindepth 1 -maxdepth 1 -type d -exec rsync -av managed_files/  {}/ \;