Skip to content

Commit

Permalink
If the 'docker' group exists, append the 'dd-agent' user to it
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Palomo Almena committed Sep 21, 2016
1 parent 47a9917 commit 0c86e86
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions recipes/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
# }
# ]

group 'docker' do
action :manage
append true
members 'dd-agent'
end

datadog_monitor 'docker' do
init_config node['datadog']['docker']['init_config']
instances node['datadog']['docker']['instances']
Expand Down
24 changes: 24 additions & 0 deletions recipes/docker_daemon.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
#
# Cookbook Name:: datadog
# Recipe:: docker_daemon
#
# Copyright 2011-2016, Datadog
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
include_recipe 'datadog::dd-agent'

# Build a data structure with configuration.
Expand Down Expand Up @@ -49,6 +67,12 @@
# }
# ]

group 'docker' do
action :manage
append true
members 'dd-agent'
end

datadog_monitor 'docker_daemon' do
init_config node['datadog']['docker_daemon']['init_config']
instances node['datadog']['docker_daemon']['instances']
Expand Down

0 comments on commit 0c86e86

Please sign in to comment.