diff --git a/src/cookbooks/resource_logs_processor/recipes/logstash_templates.rb b/src/cookbooks/resource_logs_processor/recipes/logstash_templates.rb index d3c3916..a32f1f3 100644 --- a/src/cookbooks/resource_logs_processor/recipes/logstash_templates.rb +++ b/src/cookbooks/resource_logs_processor/recipes/logstash_templates.rb @@ -32,58 +32,15 @@ EOT cat < #{consul_template_config_path}/logstash_filter_{{ .Key }}.hcl - # This block defines the configuration for a template. Unlike other blocks, - # this block may be specified multiple times to configure multiple templates. - # It is also possible to configure templates via the CLI directly. template { - # This is the source file on disk to use as the input template. This is often - # called the "Consul Template template". This option is required if not using - # the `contents` option. source = "#{consul_template_template_path}/logstash_filter_{{ .Key }}.ctmpl" - - # This is the destination path on disk where the source template will render. - # If the parent directories do not exist, Consul Template will attempt to - # create them, unless create_dest_dirs is false. destination = "#{logstash_filters_directory}/logstash_filter_{{ .Key }}.conf" - - # This options tells Consul Template to create the parent directories of the - # destination path if they do not exist. The default value is true. create_dest_dirs = false - - # This is the optional command to run when the template is rendered. The - # command will only run if the resulting template changes. The command must - # return within 30s (configurable), and it must have a successful exit code. - # Consul Template is not a replacement for a process monitor or init system. command = "" - - # This is the maximum amount of time to wait for the optional command to - # return. Default is 30s. command_timeout = "15s" - - # Exit with an error when accessing a struct or map field/key that does not - # exist. The default behavior will print "" when accessing a field - # that does not exist. It is highly recommended you set this to "true" when - # retrieving secrets from Vault. error_on_missing_key = false - - # This is the permission to render the file. If this option is left - # unspecified, Consul Template will attempt to match the permissions of the - # file that already exists at the destination path. If no file exists at that - # path, the permissions are 0644. perms = 0550 - - # This option backs up the previously rendered template at the destination - # path before writing a new one. It keeps exactly one backup. This option is - # useful for preventing accidental changes to the data without having a - # rollback strategy. backup = true - - # This is the `minimum(:maximum)` to wait before rendering a new template to - # disk and triggering a command, separated by a colon (`:`). If the optional - # maximum value is omitted, it is assumed to be 4x the required minimum value. - # This is a numeric time with a unit suffix ("5s"). There is no default value. - # The wait value for a template takes precedence over any globally-configured - # wait. wait { min = "2s" max = "10s" diff --git a/src/cookbooks/resource_logs_processor/spec/logstash_templates_spec.rb b/src/cookbooks/resource_logs_processor/spec/logstash_templates_spec.rb index ec1b5f5..3ac29a3 100644 --- a/src/cookbooks/resource_logs_processor/spec/logstash_templates_spec.rb +++ b/src/cookbooks/resource_logs_processor/spec/logstash_templates_spec.rb @@ -15,58 +15,15 @@ EOT cat < /etc/consul-template.d/conf/logstash_filter_{{ .Key }}.hcl - # This block defines the configuration for a template. Unlike other blocks, - # this block may be specified multiple times to configure multiple templates. - # It is also possible to configure templates via the CLI directly. template { - # This is the source file on disk to use as the input template. This is often - # called the "Consul Template template". This option is required if not using - # the `contents` option. source = "/etc/consul-template.d/templates/logstash_filter_{{ .Key }}.ctmpl" - - # This is the destination path on disk where the source template will render. - # If the parent directories do not exist, Consul Template will attempt to - # create them, unless create_dest_dirs is false. destination = "/etc/logstash/conf.d/logstash_filter_{{ .Key }}.conf" - - # This options tells Consul Template to create the parent directories of the - # destination path if they do not exist. The default value is true. create_dest_dirs = false - - # This is the optional command to run when the template is rendered. The - # command will only run if the resulting template changes. The command must - # return within 30s (configurable), and it must have a successful exit code. - # Consul Template is not a replacement for a process monitor or init system. command = "" - - # This is the maximum amount of time to wait for the optional command to - # return. Default is 30s. command_timeout = "15s" - - # Exit with an error when accessing a struct or map field/key that does not - # exist. The default behavior will print "" when accessing a field - # that does not exist. It is highly recommended you set this to "true" when - # retrieving secrets from Vault. error_on_missing_key = false - - # This is the permission to render the file. If this option is left - # unspecified, Consul Template will attempt to match the permissions of the - # file that already exists at the destination path. If no file exists at that - # path, the permissions are 0644. perms = 0550 - - # This option backs up the previously rendered template at the destination - # path before writing a new one. It keeps exactly one backup. This option is - # useful for preventing accidental changes to the data without having a - # rollback strategy. backup = true - - # This is the `minimum(:maximum)` to wait before rendering a new template to - # disk and triggering a command, separated by a colon (`:`). If the optional - # maximum value is omitted, it is assumed to be 4x the required minimum value. - # This is a numeric time with a unit suffix ("5s"). There is no default value. - # The wait value for a template takes precedence over any globally-configured - # wait. wait { min = "2s" max = "10s"