sous-chefs / consul

Development repository for the consul cookbook
https://supermarket.chef.io/cookbooks/consul
Apache License 2.0
192 stars 244 forks source link

dev_mode attribute causes error in startup #367

Closed isuftin closed 7 years ago

isuftin commented 7 years ago

In my Test Kitchen, I've added the dev_mode attribute to be true.

When converging Consul, I get the following issue:

==> Reloading configuration...
==> Error decoding '/etc/consul/consul.json': Config has invalid keys: dev_mode
==> Failed to reload configs

Consul is running version 0.7.0

gdavison commented 7 years ago

Looks like dev mode is a command line parameter -dev, rather than going in the config file. https://www.consul.io/docs/agent/options.html#_dev

isuftin commented 7 years ago

I concur. From reading the documents, I'm not sure there actually is a config file version of that commandline flag.

Perhaps setting this attribute in the cookbook could cause the service startup to throw in the -dev flag instead

johnbellone commented 7 years ago

I am pretty sure this is a relic from an older version of Consul. We are open to accepting PR here.

legal90 commented 7 years ago

Hi there, -dev CLI option was designed for an interactive shell session, especially for evaluation or dev purposes. That's why there is no such option available for config files. Sorry, but I don't think that we should try to implement any tricks in this cookbook to make a consul daemon running in dev mode.

If you want to bootstrap a single consul server for dev purposes using this Chef cookbook, then you can do that by setting some attributes. This is my real working example:

# my_test_recipe.rb
node.default['firewall']['allow_consul'] = false # Just to skip firewall configuration
node.default['consul']['config'] = {
  'bootstrap_expect' => 1,
  'server' => true,
  'ui' => true
}

include_recipe 'consul'
lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.