mirror of
https://github.com/krislamo/puppet-fluentd
synced 2024-12-16 13:20:35 +00:00
debian support, fix exec validations and repository
This commit is contained in:
parent
2e5892663e
commit
e693af3c42
@ -17,9 +17,12 @@ define fluentd::config::file (
|
|||||||
|
|
||||||
# clean up to ensure priority changes take effect
|
# clean up to ensure priority changes take effect
|
||||||
exec { "apply priority change for ${base_name}":
|
exec { "apply priority change for ${base_name}":
|
||||||
command => "rm ${::fluentd::conf_dir}/*-${base_name}",
|
path => '/bin:/usr/bin:/usr/local/bin',
|
||||||
onlyif => "ls ${::fluentd::conf_dir}/*-${base_name} | grep -v ${config_name}",
|
cwd => "${::fluentd::conf_dir}",
|
||||||
|
command => "rm *-${base_name}",
|
||||||
|
onlyif => "ls *-${base_name} | grep -v ${config_name}",
|
||||||
before => File[$config_path],
|
before => File[$config_path],
|
||||||
|
# require => Class['Fluentd::Config'],
|
||||||
notify => Class['Fluentd::Service'],
|
notify => Class['Fluentd::Service'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,6 +54,12 @@
|
|||||||
#
|
#
|
||||||
class fluentd (
|
class fluentd (
|
||||||
$manage_repo = $::fluentd::params::manage_repo,
|
$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_ensure = $::fluentd::params::package_ensure,
|
||||||
$package_name = $::fluentd::params::package_name,
|
$package_name = $::fluentd::params::package_name,
|
||||||
$package_install_options = $::fluentd::params::package_install_options,
|
$package_install_options = $::fluentd::params::package_install_options,
|
||||||
|
@ -17,17 +17,19 @@ class fluentd::params {
|
|||||||
$user_name = 'td-agent'
|
$user_name = 'td-agent'
|
||||||
$user_group = 'td-agent'
|
$user_group = 'td-agent'
|
||||||
$user_groups = ['adm']
|
$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 {
|
case $::osfamily {
|
||||||
'Debian': {
|
'debian': {
|
||||||
case $::operatingsystem {
|
$manage_repo = true
|
||||||
'Ubuntu': {
|
$distro_id = downcase($::lsbdistid)
|
||||||
$manage_repo = true
|
$distro_codename = $::lsbdistcodename
|
||||||
}
|
$repo_url = "http://packages.treasure-data.com/2/${distro_id}/${distro_codename}/"
|
||||||
default: {
|
|
||||||
fail("Unsupported osfamily: ${::operatingsystem}")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
fail("Unsupported osfamily: ${::osfamily}")
|
fail("Unsupported osfamily: ${::osfamily}")
|
||||||
|
@ -1,23 +1,20 @@
|
|||||||
# Configure apt::source
|
# Configure apt::source
|
||||||
#
|
#
|
||||||
class fluentd::repo::apt (
|
class fluentd::repo::apt inherits fluentd {
|
||||||
$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'
|
|
||||||
},
|
|
||||||
) {
|
|
||||||
|
|
||||||
include '::apt'
|
apt::source { $fluentd::repo_name:
|
||||||
|
location => $fluentd::repo_url,
|
||||||
apt::source { 'treasure-data':
|
comment => $fluentd::repo_desc,
|
||||||
ensure => $ensure,
|
repos => 'contrib',
|
||||||
location => $location,
|
architecture => 'amd64',
|
||||||
release => $release,
|
release => $fluentd::distro_codename,
|
||||||
repos => $repos,
|
key => {
|
||||||
key => $key,
|
id => $fluentd::repo_gpgkeyid,
|
||||||
|
source => $fluentd::repo_gpgkey,
|
||||||
|
},
|
||||||
|
include => {
|
||||||
|
'src' => false,
|
||||||
|
'deb' => true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user