Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Puppetfile validation #118

Merged
merged 2 commits into from Nov 29, 2018
Merged

Conversation

preisbeck
Copy link
Contributor

Hi,

we are currently investigating a method to validate a given Puppetfile even before a sync is actually triggered and I wondered if you could incorporate such a functionality in g10k.
I build a example implementation of this feature, so it's clearer what I want to achieve. The added '-validate' flag forces the program to exit right after it parsed a given config or Puppetfile and prints all errors that it collected during the process. The exit code is 1 in case something went wrong, and 0 if the file was parsed without a problem.

greetings
Phillip

@xorpaul
Copy link
Owner

xorpaul commented Nov 13, 2018

If you want to validate your Puppetfile before a sync to your Puppet environment is triggered then try out -dryrun, which should do exactly what you need.

I've just fixed a bug regarding -dryrun mode, so please test https://github.com/xorpaul/g10k/releases/tag/v0.5.6

@preisbeck
Copy link
Contributor Author

Thank you for the feedback. The dry-run is already too much functionality for our use case, as it actually tries to mirror data from Git repositories and the Forge.
I would like to validate the raw syntax of a Puppetfile in a Gitlab-CI run, so we can make a broken Puppetfile visible in Gitlab and more prominent for our users, best case before it even triggered an actual sync.
The problem in the CI jobs is that it may not has access to all the repositories that the Sync-server would have and fails on the 'git clone' during the dryrun.

@xorpaul xorpaul merged commit 94c53d4 into xorpaul:master Nov 29, 2018
@preisbeck preisbeck deleted the puppetfile-validation branch December 11, 2018 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants