diff options
Diffstat (limited to 'docs/dev/design_documents/resource_file_content_verification.md')
-rw-r--r-- | docs/dev/design_documents/resource_file_content_verification.md | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/docs/dev/design_documents/resource_file_content_verification.md b/docs/dev/design_documents/resource_file_content_verification.md index a67c8a5786..0ddcfeb439 100644 --- a/docs/dev/design_documents/resource_file_content_verification.md +++ b/docs/dev/design_documents/resource_file_content_verification.md @@ -8,15 +8,15 @@ user-supplied instructions before deploying the new content. The `verify` attribute of the `file`, `template`, `cookbook_file`, and `remote_file` resources will take a user-provided block or string. At converge time, a block will be passed the path to a temporary file -holding the proposed content for the file. If the block returns `true` +holding the proposed content for the file. If the block returns `true`, the provider will continue to update the file on disk as -appropriate. If the block returns false, the provider will raise an +appropriate. If the block returns `false`, the provider will raise an error. If a string argument to verify is passed, it will then be executed as -a system command. If the command's return code indicates success (0 on -unix-like system) the provider will continue to update the file on -disk as appropriate. If the command's return code indicates failure, +a system command. If the command's return code indicates success -- 0 on +unix-like system -- the provider will continue to update the file on +disk as appropriate. If the command's return code indicates failure, the provider will raise an error. The path to the temporary file with the proposed content will be @@ -24,12 +24,12 @@ available by using Ruby's sprinf formatting: "%{path}" -other variables may be made available to commands in the future. +Other variables may be made available to commands in the future. If no verification block or string is supplied by the user, the provider assumes the content is valid. -Multiple verify blocks may be provided by the user. All given verify +Multiple verify blocks may be provided by the user. All given verify block must pass before the content is deployed. As an example: @@ -72,7 +72,7 @@ template "/tmp/bat" do end ``` -Users could use this feature to shell out to tools which check the +Users could use this feature to shell out to tools, which check the configuration: ```ruby @@ -81,7 +81,7 @@ template "/etc/nginx.conf" do end ``` -Chef may ship built-in verifiers for common checks such as +Chef may ship built-in verifiers for common checks, such as content-type verification. Built-in verifiers can be used by passing well-known symbols to the verify attribute: @@ -95,7 +95,7 @@ end Typos and bugs in a template can lead Chef to render invalid configuration files on a node. In some cases, this will cause the -related service to fail a notified restart, bringing down the user's +related service to fail a notified restart and bring down the user's application. One hopes to catch such errors in testing, but that is not always possible. |