-
-
Notifications
You must be signed in to change notification settings - Fork 244
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f2a0072
commit 2ad8e63
Showing
4 changed files
with
29 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
class Chef::Provider::ConsulClientBinary < Chef::Provider::ConsulClient | ||
action :create do | ||
super | ||
include_recipe 'libarchive::default' | ||
|
||
archive = remote_file Chef::Consul.cached_archive(node) do | ||
source Chef::Consul.remote_url(node) | ||
checksum Chef::Consul.remote_checksum(node) | ||
archive = remote_file "#{Chef::Config[:file_cache_path]}/consul-#{new_resource.version}.zip" do | ||
source new_resource.url | ||
checksum new_resource.checksum | ||
end | ||
|
||
libarchive_file 'consul.zip' do | ||
libarchive_file ::File.basename(archive.path) do | ||
path archive.path | ||
extract_to Chef::Consul.install_path(node) | ||
extract_to new_resource.path | ||
extract_options :no_overwrite | ||
|
||
action :extract | ||
end | ||
|
||
directory File.basename(Chef::Consul.active_binary(node)) do | ||
directory ::Dir.dirname(new_resource.filename) do | ||
recursive true | ||
action :create | ||
owner 'root' | ||
group 'root' | ||
mode '00755' | ||
end | ||
|
||
link Chef::Consul.active_binary(node) do | ||
to Chef::Consul.latest_binary(node) | ||
link ::File.join(new_resource.path, 'consul') do | ||
to new_resource.filename | ||
end | ||
end | ||
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 |
---|---|---|
@@ -1,33 +1,33 @@ | ||
class Chef::Provider::ConsulServiceSource < Chef::Provider::ConsulService | ||
action :create do | ||
super | ||
include_recipe 'golang::default' | ||
|
||
directory File.join(node['go']['gopath'], 'src/github.com/hashicorp') do | ||
directory new_resource.path do | ||
recursive true | ||
owner 'root' | ||
group 'root' | ||
mode '00755' | ||
recursive true | ||
action :create | ||
end | ||
|
||
git File.join(node['go']['gopath'], '/src/github.com/hashicorp/consul') do | ||
repository 'https://github.com/hashicorp/consul.git' | ||
reference node['consul']['source_revision'] | ||
git new_resource.path do | ||
repository new_resource.url | ||
reference new_resource.version | ||
action :checkout | ||
end | ||
|
||
golang_package 'github.com/hashicorp/consul' do | ||
action :install | ||
end | ||
|
||
directory File.basename(Chef::Consul.active_binary(node)) do | ||
directory ::Dir.dirname(new_resource.filename) do | ||
recursive true | ||
action :create | ||
owner 'root' | ||
group 'root' | ||
mode '00755' | ||
end | ||
|
||
link Chef::Consul.active_binary(node) do | ||
to Chef::Consul.source_binary(node) | ||
link ::File.join(new_resource.path, 'consul') do | ||
to new_resource.filename | ||
end | ||
end | ||
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