Use validate_cmd & expose filename parameter#60
Conversation
Instead of defining a file and then validate it using a separate exec this uses the built in functionality, which prevents the file from being written out if it's invalid.
530269c to
96843d5
Compare
| mode => '0644', | ||
| owner => 'root', | ||
| group => 'root', | ||
| validate_cmd => '/usr/bin/openssl x509 -in %s -noout', |
There was a problem hiding this comment.
are you sure that this path is correct on all operating systems? Is there something around that uses /bin/openssl? We had problems like that in the past.
There was a problem hiding this comment.
Pretty sure. At least on EL (7+) /bin is a symlink to /usr/bin. Debian and Ubuntu both have it in /usr/bin. Not sure about suse mentioned in metadata.json, but I'd be quite confident in assuming it.
I wasn't sure if you can simply use openssl and expect it to use $path.
There was a problem hiding this comment.
as far as I know it needs to be an absolute path, that's how we implemented it in other modules as well (puppet/nginx, saz/ssh)
|
tag v5.1.0 has a bug with %s all temporary files has a 's' at the end and the validate_cmd command fails because the filenames doesn't match. |
Could you submit a PR to fix that? Edit: I only now saw #72. |
See individual commits for details.