consul_config

March 19, 2026 ยท View on GitHub

Manages the Consul agent configuration file in JSON format.

Actions

ActionDescription
:createCreates the configuration file (default)
:deleteRemoves the configuration file

Properties

PropertyTypeDefaultDescription
pathStringnamePath to config file (name property)
ownerString'consul'File owner
groupString'consul'File group
config_dirString'/etc/consul/conf.d'Configuration directory
config_dir_modeString'0755'Config directory mode
optionsHash{}Additional options merged into config
servertrue, falseRun as server
bootstraptrue, falseBootstrap the cluster
datacenterStringDatacenter name
encryptStringGossip encryption key
uitrue, falseEnable the web UI
bind_addrStringBind address
client_addrStringClient address
retry_joinArrayAddresses to join on start
aclHash, MashACL configuration block

See the Consul documentation for all available configuration options. Most options are exposed as properties.

Examples

Server configuration

consul_config '/etc/consul/consul.json' do
  owner 'root'
  group 'consul'
  server true
  bootstrap true
  datacenter 'dc1'
  encrypt 'CGXC2NsXW4AvuB4h5ODYzQ=='
  ui true
end

Client configuration

consul_config '/etc/consul/consul.json' do
  retry_join %w(10.0.0.1 10.0.0.2 10.0.0.3)
end