-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: make etcd_bin_prefix
customizable
#1
Conversation
etcd_bin_prefix
customizable
d7b933e
to
ca37a55
Compare
ca37a55
to
3a2a64a
Compare
@@ -16,8 +16,9 @@ def self.included(base) | |||
##################### | |||
# set default service name like etcd.service | |||
property :default_service_name, kind_of: [TrueClass, FalseClass], default: false | |||
property :etcd_bin_prefix, String, default: '/usr/local/bin', desired_state: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default used to be /usr/bin
. But from what I understand that is not what /usr/bin
is for (https://unix.stackexchange.com/a/259238). /usr/local/bin
seems more appropriate.
file 'etcd_checksum' do | ||
path "#{new_resource.etcd_bin_prefix}/.etcd_checksum" | ||
content new_resource.checksum | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to store the checksum in a file so that we trigger the extraction of etcd
and etcdctl
when the checksum (hence the etcd version) changes.
def etcd_bin | ||
"#{etcd_bin_prefix}/etcd" | ||
end | ||
|
||
def etcd_bin_prefix | ||
'/usr/bin' | ||
end | ||
|
||
def etcdctl_bin | ||
"#{etcdctl_bin_prefix}/etcdctl" | ||
end | ||
|
||
def etcdctl_bin_prefix | ||
etcd_bin_prefix | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are now only declared in a single place, libraries/helpers_service.rb
, rather than duplicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Related to sous-chefs#139
I tested it in staging. PR on the kitchen incoming.