diff --git a/manifests/init.pp b/manifests/init.pp index e20dc441..d0383841 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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 { diff --git a/manifests/integrations/directory.pp b/manifests/integrations/directory.pp index fedafa40..50e8e83a 100644 --- a/manifests/integrations/directory.pp +++ b/manifests/integrations/directory.pp @@ -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": diff --git a/manifests/params.pp b/manifests/params.pp index aae7c3e3..4a85445e 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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}") } diff --git a/manifests/redhat.pp b/manifests/redhat.pp index 4861433c..d0499d27 100644 --- a/manifests/redhat.pp +++ b/manifests/redhat.pp @@ -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'], } } diff --git a/manifests/reports.pp b/manifests/reports.pp index 8bcbd99c..e0e2a7d2 100644 --- a/manifests/reports.pp +++ b/manifests/reports.pp @@ -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: @@ -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'] } @@ -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': diff --git a/manifests/ubuntu.pp b/manifests/ubuntu.pp index 4ff69df0..ebc95e12 100644 --- a/manifests/ubuntu.pp +++ b/manifests/ubuntu.pp @@ -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'], } }