ansible-collections / ansible-consul

:satellite: Ansible role for Hashicorp Consul clusters
https://galaxy.ansible.com/ansible-community/consul/
BSD 2-Clause "Simplified" License
452 stars 313 forks source link

Support for consul validate #518

Closed Lusitaniae closed 6 months ago

Lusitaniae commented 1 year ago

Ideally we'd have some validation task when updating template files

I'm trying something like this `

validate: "consul validate %s {{ consul_configd_path }}"

`

Which fails with:

Config validation failed: Multiple private IPv4 addresses found. Please configure one with 'bind' and/or 'advertise'.

Related to https://github.com/hashicorp/consul/issues/3897?

bastienwirtz commented 1 year ago

Hello @Lusitaniae,

Have you tried adding the main configuration file in the same command ?

consul validate {{ consul_config_path }}/config.json {{ consul_configd_path }}

I just opened a PR to add the configuration validation (cf https://github.com/ansible-community/ansible-consul/pull/565).