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

Add validate option #2

Open
LeonB opened this issue Dec 8, 2013 · 2 comments
Open

Add validate option #2

LeonB opened this issue Dec 8, 2013 · 2 comments

Comments

@LeonB
Copy link

LeonB commented Dec 8, 2013

Would it be possible to add a validate option just like the template and lineinfile module.

@paluh
Copy link
Owner

paluh commented Feb 21, 2014

Could you describe your requirement in more details?

@nogweii
Copy link

nogweii commented Jun 11, 2017

It'd be nice for peace of mind to include the validate option, although augeas does go out of it's way to introducing syntax erros, it's possilbe the validation command can go above and beyond.

With template, the validate option allows the user to pass in a format string (containing '%s') that will be executed on the guest. The template module will expand the jinja template and save it to a temporary file. It'll execute the command, subsituting %s for the path to the temporary file. Assuming an exit code of 0 means that there weren't any syntax errors (or any other thing that the command checks for), it'll only then move the temporary file to the actual destiation.

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

No branches or pull requests

3 participants