consul 烹饪书的开发仓库
Resource cookbook which installs and configures HashiCorp Consul.
This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you'd like to know more please visit sous-chefs.org or come chat with us on the Chef Community Slack in #sous-chefs.
This cookbook provides custom resources only — no recipes or node attributes. Use these resources directly in your wrapper cookbook recipes.
consul_installation 'latest' do
install_method 'repository'
end
group 'consul' do
system true
end
user 'consul' do
system true
group 'consul'
shell '/bin/false'
end
config = consul_config '/etc/consul/consul.json' do
owner 'root'
group 'consul'
server true
bootstrap true
datacenter 'dc1'
ui true
notifies :reload, 'consul_service[consul]', :delayed
end
consul_service 'consul' do
config_file config.path
user 'consul'
group 'consul'
end
consul_installation 'latest' do
install_method 'repository'
end
group 'consul' do
system true
end
user 'consul' do
system true
group 'consul'
shell '/bin/false'
end
config = consul_config '/etc/consul/consul.json' do
retry_join %w(10.0.0.1 10.0.0.2 10.0.0.3)
notifies :reload, 'consul_service[consul]', :delayed
end
consul_service 'consul' do
config_file config.path
user 'consul'
group 'consul'
end
The consul_installation resource supports two methods:
repository (default) — Installs via official HashiCorp APT/YUM repositories. Recommended for most platforms.binary — Downloads a zip archive from releases.hashicorp.com. Required for openSUSE (no official repo).consul_installation '1.22.5' do
install_method 'binary'
checksum 'abc123...'
end
consul_definition 'redis' do
type 'service'
parameters(tags: %w(master), address: '127.0.0.1', port: 6379)
notifies :reload, 'consul_service[consul]', :delayed
end
consul_watch 'app-deploy' do
type 'event'
parameters(handler: '/usr/local/bin/clear-disk-cache.sh')
notifies :reload, 'consul_service[consul]', :delayed
end
The consul_acl, consul_policy, consul_role, and consul_token resources require the Diplomat Ruby gem.
consul_acl '49f06aa9-782f-465a-becf-44f0aaefd335' do
acl_name 'AwesomeApp Token'
type 'client'
rules 'key "" { policy = "read" }'
auth_token 'master-token'
end
Version 6.0 is a breaking change:
config_v0 resource deletedThis project exists thanks to all the people who contribute.
Thank you to all our backers!
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
依赖关系仪表板
Consul 客户端安装最新包时缺少校验和
Consul 1.12.x 中的过时字段
为什么禁用单元测试?是否有计划将其恢复?
功能请求: 添加对 amazonlinux 的支持
在更新 consul 版本期间重启 system.d 服务
为了重新加载 Windows 服务,必须在非服务器代理上设置 acl_master_token
在 Windows 上未启动 consul 服务