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

Validate command for config files doesn't work #376

Closed
joshuaspence opened this issue Oct 25, 2017 · 4 comments
Closed

Validate command for config files doesn't work #376

joshuaspence opened this issue Oct 25, 2017 · 4 comments

Comments

@joshuaspence
Copy link
Contributor

With Consul 1.0, the change from #372 doesn't seem to work because the temporary config file doesn't end with .json.

       	Error: Execution of '/usr/local/bin/consul validate /etc/consul/config.json20171025-5833-1sgyj3d > /dev/null' returned 1: Config validation failed: Missing or invalid file extension for "/etc/consul/config.json20171025-5833-1sgyj3d". Please use ".json" or ".hcl".
       	Error: /Stage[main]/Consul::Config/File[consul config.json]/ensure: change from absent to present failed: Execution of '/usr/local/bin/consul validate /etc/consul/config.json20171025-5833-1sgyj3d > /dev/null' returned 1: Config validation failed: Missing or invalid file extension for "/etc/consul/config.json20171025-5833-1sgyj3d". Please use ".json" or ".hcl".
@joshuaspence
Copy link
Contributor Author

It looks like Consul version 1.0.1 addresses this problem, see hashicorp/consul#3620.

@khdevel
Copy link

khdevel commented Nov 14, 2017

It is almost fixed... the only thing is missing is that the symbolic link still exist so puppet has problem during some second config.json update

Error: Execution of '/usr/local/bin/consul validate $(ln -s /etc/consul/config.json20171114-19498-11xf5vn /tmp/consul-config.json && echo "/tmp/consul-config.json") > /dev/null' returned 1: ln: failed to create symbolic link '/tmp/consul-config.json': File exists
$ ll /tmp/consul-config.json
lrwxrwxrwx. 1 root root 43 Nov 14 07:59 /tmp/consul-config.json -> /etc/consul/config.json20171114-2182-v34nfw

ln -sf should help...

khdevel pushed a commit to khdevel/puppet-consul that referenced this issue Nov 14, 2017
- some fix related to the issue voxpupuli#376 (voxpupuli#376)

Changes to be committed:
	modified:   manifests/config.pp
@khdevel khdevel mentioned this issue Nov 14, 2017
khdevel pushed a commit to khdevel/puppet-consul that referenced this issue Nov 14, 2017
- some fix related to the issue voxpupuli#376 (voxpupuli#376)

Changes to be committed:
	modified:   manifests/config.pp
@solarkennedy
Copy link
Contributor

I just merged in a PR that does ln -sf

@joshuaspence
Copy link
Contributor Author

The symbolic link approach feels so dirty... Why not just use -config-format=json?

spuder pushed a commit to spuder/puppet-consul that referenced this issue Feb 25, 2020
- some fix related to the issue voxpupuli#376 (voxpupuli#376)

Changes to be committed:
	modified:   manifests/config.pp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants