Skip to content

Commit

Permalink
Merge pull request DataDog#47 from mrchilds/linting
Browse files Browse the repository at this point in the history
Fix linting issue
  • Loading branch information
LeoCavaille committed Oct 20, 2014
2 parents 5ed03e5 + 94ca1a2 commit 29bc0c4
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 41 deletions.
20 changes: 10 additions & 10 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -85,29 +85,29 @@
default: { $_loglevel = 'INFO' }
}

case $operatingsystem {
"Ubuntu","Debian" : { include datadog_agent::ubuntu }
"RedHat","CentOS","Fedora","Amazon","Scientific" : { include datadog_agent::redhat }
case $::operatingsystem {
'Ubuntu','Debian' : { include datadog_agent::ubuntu }
'RedHat','CentOS','Fedora','Amazon','Scientific' : { include datadog_agent::redhat }
default: { fail("Class[datadog_agent]: Unsupported operatingsystem: ${::operatingsystem}") }
}

file { "/etc/dd-agent":
file { '/etc/dd-agent':
ensure => present,
owner => "root",
group => "root",
owner => 'root',
group => 'root',
mode => 0755,
require => Package["datadog-agent"],
require => Package['datadog-agent'],
}

# main agent config file
file { "/etc/dd-agent/datadog.conf":
file { '/etc/dd-agent/datadog.conf':
ensure => file,
content => template("datadog_agent/datadog.conf.erb"),
content => template('datadog_agent/datadog.conf.erb'),
owner => $dd_user,
group => $dd_group,
mode => 0640,
notify => Service[$service_name],
require => File["/etc/dd-agent"],
require => File['/etc/dd-agent'],
}

if $puppet_run_reports {
Expand Down
2 changes: 1 addition & 1 deletion manifests/integrations/directory.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
) inherits datadog_agent::params {

if $directory == undef {
fail("you must specify a directory path within the datadog_agent::integrations::directory class")
fail('you must specify a directory path within the datadog_agent::integrations::directory class')
}

file { "${conf_dir}/directory.yaml":
Expand Down
14 changes: 7 additions & 7 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
# Sample Usage:
#
class datadog_agent::params {
$conf_dir = "/etc/dd-agent/conf.d"
$dd_user = "dd-agent"
$dd_group = "root"
$package_name = "datadog-agent"
$service_name = "datadog-agent"
$conf_dir = '/etc/dd-agent/conf.d'
$dd_user = 'dd-agent'
$dd_group = 'root'
$package_name = 'datadog-agent'
$service_name = 'datadog-agent'

case $operatingsystem {
"Ubuntu","Debian" : {
'Ubuntu','Debian' : {
$rubydev_package = 'ruby-dev'
}
"RedHat","CentOS","Fedora","Amazon","Scientific" : {
'RedHat','CentOS','Fedora','Amazon','Scientific' : {
$rubydev_package = 'ruby-devel'
}
default: { fail("Class[datadog_agent]: Unsupported operatingsystem: ${::operatingsystem}") }
Expand Down
4 changes: 2 additions & 2 deletions manifests/redhat.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
require => Yumrepo['datadog'],
}

service { "datadog-agent":
service { 'datadog-agent':
ensure => $::datadog_agent::service_ensure,
enable => $::datadog_agent::service_enable,
hasstatus => false,
pattern => 'dd-agent',
require => Package["datadog-agent"],
require => Package['datadog-agent'],
}

}
12 changes: 6 additions & 6 deletions manifests/reports.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Class: datadog_agent::reports
#
# This class configures the puppetmaster for reporting back to
# This class configures the puppetmaster for reporting back to
# the datadog service.
#
# Parameters:
Expand All @@ -23,7 +23,7 @@

# check to make sure that you're not installing rubydev somewhere else
if ! defined(Package[$rubydev_package]) {
package {"$rubydev_package":
package {$rubydev_package:
ensure => installed,
before => Package['dogapi']
}
Expand All @@ -34,13 +34,13 @@
rubygems_update => false
}

file { "/etc/dd-agent/datadog.yaml":
file { '/etc/dd-agent/datadog.yaml':
ensure => file,
content => template("datadog_agent/datadog.yaml.erb"),
content => template('datadog_agent/datadog.yaml.erb'),
owner => $puppetmaster_user,
group => "root",
group => 'root',
mode => 0640,
require => File["/etc/dd-agent"],
require => File['/etc/dd-agent'],
}

package{'dogapi':
Expand Down
31 changes: 16 additions & 15 deletions manifests/ubuntu.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,40 +14,41 @@
$apt_key = 'C7A7DA52'
) {

exec { "datadog_key":
command => "/usr/bin/apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys $apt_key",
unless => "/usr/bin/apt-key list | grep $apt_key | grep expires",
exec { 'datadog_key':
command => "/usr/bin/apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys ${apt_key}",
unless => "/usr/bin/apt-key list | grep ${apt_key} | grep expires",
notify => Exec['datadog_apt-get_update'],
}

file { "/etc/apt/sources.list.d/datadog.list":
source => "puppet:///modules/datadog_agent/datadog.list",
owner => 'root',
group => 'root',
notify => Exec['datadog_apt-get_update'],
file { '/etc/apt/sources.list.d/datadog.list':
source => 'puppet:///modules/datadog_agent/datadog.list',
owner => 'root',
group => 'root',
notify => Exec['datadog_apt-get_update'],
}

exec { 'datadog_apt-get_update':
command => '/usr/bin/apt-get update',
refreshonly => true,
}
}

package { "datadog-agent-base":
package { 'datadog-agent-base':
ensure => absent,
before => Package['datadog-agent'],
}

package { "datadog-agent":
ensure => latest,
require => [ File["/etc/apt/sources.list.d/datadog.list"], Exec['datadog_apt-get_update'] ],
package { 'datadog-agent':
ensure => latest,
require => [File['/etc/apt/sources.list.d/datadog.list'],
Exec['datadog_apt-get_update']],
}

service { "datadog-agent":
service { 'datadog-agent':
ensure => $::datadog_agent::service_ensure,
enable => $::datadog_agent::service_enable,
hasstatus => false,
pattern => 'dd-agent',
require => Package["datadog-agent"],
require => Package['datadog-agent'],
}

}

0 comments on commit 29bc0c4

Please sign in to comment.