Skip to content

Validate configuration #387

@DoctorFTB

Description

@DoctorFTB

Is your feature request related to a problem? Please describe

I have a problem with configuration by validation

Describe the solution you'd like

If my configuration is invalid (based on the current handlers code), an error is thrown

Describe alternatives you've considered

Nope

Additional context

For example I have a config:

nginx_config_http_template_enable: true
nginx_config_http_template:
  - template_file: http/default.conf.j2
    deployment_location: /etc/nginx/conf.d/path-to.conf
    config:
      servers:
        - core:
            server_name1: some.example.com
            locations:
              - location: /
                proxy:
                  pass: http://127.0.0.1:8080

And in this case:
First mistake is that "server_name1" is not a valid name (cuz 1 at the end)
Second mistake is is the number of indents (need left for 2 spaces)
After applying this configuration I received an empty /etc/nginx/conf.d/path-to.conf file

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    Status

    To do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions