docs and changelog for `nomad config validate` (#12031)

This commit is contained in:
Tim Gross 2022-02-09 10:20:45 -05:00 committed by GitHub
parent 1dcfff2f70
commit 59c8558969
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 88 additions and 0 deletions

3
.changelog/9198.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:improvement
cli: add `nomad config validate` command to check configuration files without an agent
```

View File

@ -0,0 +1,21 @@
---
layout: docs
page_title: 'Commands: config'
description: |
The config command interacting with configurations.
---
# Command: config
The `config` command is used to interact with configurations.
## Usage
Usage: `nomad config <subcommand> [options]`
Run `nomad config <subcommand> -h` for help on that subcommand. The
following subcommands are available:
- [`config validate`][validate] - Validate configuration files
[validate]: /docs/commands/config/validate 'Validate configuration files'

View File

@ -0,0 +1,51 @@
---
layout: docs
page_title: 'Commands: config validate'
description: |
The config validate command is used to validate Nomad configuration files.
---
# Command: config validate
The `config validate` command performs validation on a set of Nomad
configuration files. This is useful to test the Nomad configuration
without starting the agent.
## Usage
```plaintext
nomad config validate <config_path> [<config_path...>]
```
The `config validate` command requires a path to either a single
configuration file or a directory of configuration files to use for
configuring the Nomad agent. This option can be specified multiple
times. If multiple config files are passed, the values from each will
be merged together. During merging, values from files found later in
the list are merged over values from previously parsed files.
This command cannot operate on partial configuration fragments since
those won't pass the full agent validation. This command does not
require an ACL token.
Returns 0 if the configuration is valid, or 1 if there are problems.
## General Options
@include 'general_options.mdx'
## Examples
Validate a configuration file:
```shell-session
$ nomad config validate ./nomad.hcl
Configuration is valid!
```
Validate a directory of configuration files:
```shell-session
$ nomad config validate /etc/nomad.d
Configuration is valid!
```

View File

@ -315,6 +315,19 @@
} }
] ]
}, },
{
"title": "config",
"routes": [
{
"title": "Overview",
"path": "commands/config"
},
{
"title": "validate",
"path": "commands/config/validate"
}
]
},
{ {
"title": "deployment", "title": "deployment",
"routes": [ "routes": [