1
0
mirror of https://github.com/krislamo/puppet-fluentd synced 2024-12-16 05:10:36 +00:00

debian support, fix exec validations and repository

This commit is contained in:
Coto Cisternas 2016-01-15 17:35:19 -03:00
parent 2e5892663e
commit e693af3c42
4 changed files with 38 additions and 30 deletions

View File

@ -17,9 +17,12 @@ define fluentd::config::file (
# clean up to ensure priority changes take effect
exec { "apply priority change for ${base_name}":
command => "rm ${::fluentd::conf_dir}/*-${base_name}",
onlyif => "ls ${::fluentd::conf_dir}/*-${base_name} | grep -v ${config_name}",
path => '/bin:/usr/bin:/usr/local/bin',
cwd => "${::fluentd::conf_dir}",
command => "rm *-${base_name}",
onlyif => "ls *-${base_name} | grep -v ${config_name}",
before => File[$config_path],
# require => Class['Fluentd::Config'],
notify => Class['Fluentd::Service'],
}

View File

@ -54,6 +54,12 @@
#
class fluentd (
$manage_repo = $::fluentd::params::manage_repo,
$repo_gpgcheck = $::fluentd::params::repo_gpgcheck,
$repo_gpgkey = $::fluentd::params::repo_gpgkey,
$repo_gpgkeyid = $::fluentd::params::repo_gpgkeyid,
$repo_url = $::fluentd::params::repo_url,
$repo_name = $::fluentd::params::repo_name,
$repo_desc = $::fluentd::params::repo_desc,
$package_ensure = $::fluentd::params::package_ensure,
$package_name = $::fluentd::params::package_name,
$package_install_options = $::fluentd::params::package_install_options,

View File

@ -17,17 +17,19 @@ class fluentd::params {
$user_name = 'td-agent'
$user_group = 'td-agent'
$user_groups = ['adm']
# repo params
$repo_gpgcheck = true
$repo_gpgkey = 'http://packages.treasure-data.com/GPG-KEY-td-agent'
$repo_gpgkeyid = 'C901622B5EC4AF820C38AB861093DB45A12E206F'
$repo_name = 'treasuredata'
$repo_desc = 'TreasureData'
case $::osfamily {
'Debian': {
case $::operatingsystem {
'Ubuntu': {
$manage_repo = true
}
default: {
fail("Unsupported osfamily: ${::operatingsystem}")
}
}
'debian': {
$manage_repo = true
$distro_id = downcase($::lsbdistid)
$distro_codename = $::lsbdistcodename
$repo_url = "http://packages.treasure-data.com/2/${distro_id}/${distro_codename}/"
}
default: {
fail("Unsupported osfamily: ${::osfamily}")

View File

@ -1,23 +1,20 @@
# Configure apt::source
#
class fluentd::repo::apt (
$ensure = 'present',
$location = downcase("https://packages.treasuredata.com/2/${::operatingsystem}/${::lsbdistcodename}"),
$release = $::lsbdistcodename,
$repos = 'contrib',
$key = {
'id' => 'C901622B5EC4AF820C38AB861093DB45A12E206F',
'source' => 'https://packages.treasuredata.com/GPG-KEY-td-agent'
},
) {
class fluentd::repo::apt inherits fluentd {
include '::apt'
apt::source { 'treasure-data':
ensure => $ensure,
location => $location,
release => $release,
repos => $repos,
key => $key,
apt::source { $fluentd::repo_name:
location => $fluentd::repo_url,
comment => $fluentd::repo_desc,
repos => 'contrib',
architecture => 'amd64',
release => $fluentd::distro_codename,
key => {
id => $fluentd::repo_gpgkeyid,
source => $fluentd::repo_gpgkey,
},
include => {
'src' => false,
'deb' => true,
},
}
}
}