Skip to content

Commit 541e737

Browse files
committed
Add parameters to ceph integration
Closes: #321
1 parent d8f40d8 commit 541e737

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

manifests/integrations/ceph.pp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,24 @@
33
# This class will install the necessary configuration for the ceph integration
44
#
55
# Parameters:
6+
# $tags
7+
# Optional array of tags
8+
# $ceph_cmd
9+
# Optional ceph cmd
610

711
# Sample Usage:
812
#
913
# class { 'datadog_agent::integrations::ceph' :
1014
# }
1115
#
1216
class datadog_agent::integrations::ceph(
17+
$tags = [ 'name:ceph_cluster' ],
18+
$ceph_cmd = '/usr/bin/ceph',
1319
) inherits datadog_agent::params {
1420
include datadog_agent
1521

22+
validate_array($tags)
23+
1624
file { '/etc/sudoers.d/datadog_ceph':
1725
content => "# This file is required for dd ceph \ndd-agent ALL=(ALL) NOPASSWD:/usr/bin/ceph\n"
1826
}

templates/agent-conf.d/ceph.yaml.erb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
init_config:
22

33
instances:
4+
<% if @tags and ! @tags.empty? -%>
45
- tags:
5-
- name:ceph_cluster
6+
<%- @tags.each do |tag| -%>
7+
- <%= tag %>
8+
<%- end -%>
9+
<% end -%>
610

7-
ceph_cmd: /usr/bin/ceph
11+
ceph_cmd: <%= @crm_mon_cmd %>
812

913
# If your environment requires sudo, please add a line like:
1014
# dd-agent ALL=(ALL) NOPASSWD:/usr/bin/ceph

0 commit comments

Comments
 (0)