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

Support running a validation command on the destination file. #243

Merged
merged 4 commits into from
Feb 12, 2015
Merged

Support running a validation command on the destination file. #243

merged 4 commits into from
Feb 12, 2015

Conversation

jmkeyes
Copy link
Contributor

@jmkeyes jmkeyes commented Nov 13, 2014

This patch allows a user to pass an optional validate_cmd parameter to a concat resource, which in turn will run a command to validate the output of the file before the module replaces it. It follows the same semantics as the validate_cmd parameter to the file resource.

Example:

concat { '/etc/httpd/conf/httpd.conf':
  ensure       => file,
  validate_cmd => '/usr/sbin/apache2 -t -f %',
  owner        => 'apache2',
  group        => 'apache2',
  mode         => '0644'
}

@jhoblitt
Copy link
Contributor

This would be a great feature. However, it needs unit tests and really should have acceptance tests as well.

@igalic
Copy link
Contributor

igalic commented Nov 13, 2014

and it probably won't work :(

@jhoblitt
Copy link
Contributor

@igalic Why not? The aggregiate file generated by the script is copied into place with a file resource.

@igalic
Copy link
Contributor

igalic commented Nov 14, 2014

aaah. sorry, i thought that was for the fragments


ignore me.

@jmkeyes
Copy link
Contributor Author

jmkeyes commented Nov 26, 2014

@jhoblitt, Are these the tests you're looking for?

@jhoblitt
Copy link
Contributor

@jmkeyes Aye! I'll give it a try as soon as I have the chance.

underscorgan pushed a commit that referenced this pull request Feb 12, 2015
Support running a validation command on the destination file.
@underscorgan underscorgan merged commit 3a634af into puppetlabs:master Feb 12, 2015
@underscorgan
Copy link
Contributor

Thanks for the contribution @jmkeyes !

@igalic
Copy link
Contributor

igalic commented Feb 12, 2015

@antaflos: ^ is this what you wanted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants