Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support heartbeat 6.x
Browse files Browse the repository at this point in the history
Due to a naming conflict on Debian, the package and service were
namespaced diffrently from 6 onwards

See elastic/beats#4601
brianvans committed Mar 30, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 9a629bc commit d7da233
Showing 5 changed files with 37 additions and 15 deletions.
20 changes: 13 additions & 7 deletions .kitchen.dokken.yml
Original file line number Diff line number Diff line change
@@ -8,6 +8,15 @@ transport:

provisioner:
name: dokken
attributes:
heartbeat:
config:
output.elasticsearch:
hosts: ["127.0.0.1:9200"]
heartbeat.monitors:
- type: icmp
schedule: '*/5 * * * * * *'
hosts: ['127.0.0.1']

# verifier:
# name: inspec
@@ -39,12 +48,9 @@ suites:
- name: default
run_list:
- recipe[elastic-heartbeat::default]
- name: version_6
run_list:
- recipe[elastic-heartbeat::default]
attributes:
heartbeat:
config:
output.elasticsearch:
hosts: ["127.0.0.1:9200"]
heartbeat.monitors:
- type: icmp
schedule: '*/5 * * * * * *'
hosts: ['127.0.0.1']
version: '6.2.3'
20 changes: 13 additions & 7 deletions .kitchen.yml
Original file line number Diff line number Diff line change
@@ -4,6 +4,15 @@ driver:

provisioner:
name: chef_zero
attributes:
heartbeat:
config:
output.elasticsearch:
hosts: ["127.0.0.1:9200"]
heartbeat.monitors:
- type: icmp
schedule: '*/5 * * * * * *'
hosts: ['127.0.0.1']

platforms:
- name: ubuntu-14.04
@@ -20,12 +29,9 @@ suites:
- name: default
run_list:
- recipe[elastic-heartbeat::default]
- name: version_6
run_list:
- recipe[elastic-heartbeat::default]
attributes:
heartbeat:
config:
output.elasticsearch:
hosts: ["127.0.0.1:9200"]
heartbeat.monitors:
- type: icmp
schedule: '*/5 * * * * * *'
hosts: ['127.0.0.1']
version: '6.2.3'
9 changes: 9 additions & 0 deletions recipes/attributes.rb
Original file line number Diff line number Diff line change
@@ -22,3 +22,12 @@
node.default['heartbeat']['yum']['gpgkey'] = 'https://artifacts.elastic.co/GPG-KEY-elasticsearch'
node.default['heartbeat']['apt']['uri'] = "https://artifacts.elastic.co/packages/#{major_version}.x/apt"
node.default['heartbeat']['apt']['key'] = 'https://artifacts.elastic.co/GPG-KEY-elasticsearch'

# The package and service weren't namespaced with "-elastic" prior to 6.x
if major_version.to_i < 6
node.default['heartbeat']['package_name'] = 'heartbeat'
node.default['heartbeat']['service_name'] = 'heartbeat'
else
node.default['heartbeat']['package_name'] = 'heartbeat-elastic'
node.default['heartbeat']['service_name'] = 'heartbeat-elastic'
end
1 change: 1 addition & 0 deletions recipes/config.rb
Original file line number Diff line number Diff line change
@@ -37,6 +37,7 @@
service_action = node['heartbeat']['disable_service'] ? [:disable, :stop] : [:enable, :nothing]

service 'heartbeat' do
service_name node['heartbeat']['service_name']
provider Chef::Provider::Service::Solaris if node['platform_family'] == 'solaris2'
retries node['heartbeat']['service']['retries']
retry_delay node['heartbeat']['service']['retry_delay']
2 changes: 1 addition & 1 deletion recipes/install.rb
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@
end
end

package 'heartbeat' do # ~FC009
package node['heartbeat']['package_name'] do # ~FC009
version version_string unless node['heartbeat']['ignore_version']
options node['heartbeat']['apt']['options'] if node['heartbeat']['apt']['options'] && node['platform_family'] == 'debian'
notifies :restart, 'service[heartbeat]' if node['heartbeat']['notify_restart'] && !node['heartbeat']['disable_service']

0 comments on commit d7da233

Please sign in to comment.