open-consul/website/pages/commands/validate.mdx
Jasmine W 8ae3332165
docs: update structure (#8506)
- moved and renamed files/folders based on new structure
- updated docs navigation based on new structure
- moved CLI to top nav (created commands.jsx and commands-navigation.js)
- updated and added redirects
- updating to be consistent with standalone categories
- changing "overview" link in top nav to lead to where intro was moved (docs/intro)
- adding redirects for intro content
- deleting old intro folders
- format all data/navigation files
- deleting old commands folder
- reverting changes to glossary page
- adjust intro navigation for removal of 'vs' paths
- add helm page redirect
- fix more redirects
- add a missing redirect
- fix broken anchor links and formatting mistakes
- deleted duplicate section, added redirect, changed link
- removed duplicate glossary page
2020-09-01 11:14:13 -04:00

38 lines
1.3 KiB
Plaintext

---
layout: commands
page_title: 'Commands: Validate'
sidebar_title: validate
description: >
The `consul validate` command tests that config files are valid by attempting
to parse them. Useful to ensure a configuration change will not cause consul
to fail after a restart.
---
# Consul Validate
The `consul validate` command performs a thorough sanity test on Consul
configuration files. For each file or directory given, the command will
attempt to parse the contents just as the `consul agent` command would,
and catch any errors.
This is useful to do a test of the configuration only, without actually
starting the agent. This performs all of the validation the agent would, so
this should be given the complete set of configuration files that are going
to be loaded by the agent. This command cannot operate on partial
configuration fragments since those won't pass the full agent validation.
For more information on the format of Consul's configuration files, read the
consul agent [Configuration Files](/docs/agent/options#configuration-files)
section.
## Usage
Usage: `consul validate [options] FILE_OR_DIRECTORY...`
Returns 0 if the configuration is valid, or 1 if there are problems.
```shell-session
$ consul validate /etc/consul.d
Configuration is valid!
```