Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs and changelog for nomad config validate #12031

Merged
merged 2 commits into from
Feb 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/9198.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
cli: add `nomad config validate` command to check configuration files without an agent
```
21 changes: 21 additions & 0 deletions website/content/docs/commands/config/index.mdx
Original file line number Diff line number Diff line change
@@ -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'
51 changes: 51 additions & 0 deletions website/content/docs/commands/config/validate.mdx
Original file line number Diff line number Diff line change
@@ -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!
```
13 changes: 13 additions & 0 deletions website/data/docs-nav-data.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,19 @@
}
]
},
{
"title": "config",
"routes": [
{
"title": "Overview",
"path": "commands/config"
},
{
"title": "validate",
"path": "commands/config/validate"
}
]
},
{
"title": "deployment",
"routes": [
Expand Down