-
-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Derive default config permissions from attributes
Use the same attributes to provide defaults for consul_definition and consul_watch as are used for consul_config. Consolidated each test suite as a recipe in the consul_spec cookbook to reduce the boilerplate this would have added to kitchen.yml.
- Loading branch information
1 parent
450c0cc
commit d40c677
Showing
9 changed files
with
83 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
# The ruby interpreter is guaranteed to exist since it's currently running. | ||
file "/consul_definition_check.rb" do | ||
content (<<-EOF).gsub(/^ */, '') | ||
#!#{RbConfig.ruby} | ||
exit 0 | ||
EOF | ||
unless node.platform?('windows') | ||
owner 'root' | ||
mode '0755' | ||
end | ||
end | ||
|
||
consul_definition 'consul_definition_check' do | ||
type 'check' | ||
parameters(id: "consul_definition_check", | ||
script: '/consul_definition_check.rb', | ||
interval: '10s', | ||
timeout: '10s') | ||
notifies :reload, 'consul_service[consul]', :delayed | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
# The ruby interpreter is guaranteed to exist since it's currently running. | ||
file "/consul_watch_handler.rb" do | ||
content (<<-EOF).gsub(/^ */, '') | ||
#!#{RbConfig.ruby} | ||
exit 0 | ||
EOF | ||
unless node.platform?('windows') | ||
owner 'root' | ||
mode '0755' | ||
end | ||
end | ||
|
||
consul_watch 'consul_watch_check' do | ||
type 'event' | ||
parameters(handler: "/consul_watch_handler.rb") | ||
notifies :reload, 'consul_service[consul]', :delayed | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters