mirror of
https://github.com/krislamo/puppet-fluentd
synced 2024-11-10 04:50:34 +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 {
|
|
||||||
'Ubuntu': {
|
|
||||||
$manage_repo = true
|
$manage_repo = true
|
||||||
}
|
$distro_id = downcase($::lsbdistid)
|
||||||
default: {
|
$distro_codename = $::lsbdistcodename
|
||||||
fail("Unsupported osfamily: ${::operatingsystem}")
|
$repo_url = "http://packages.treasure-data.com/2/${distro_id}/${distro_codename}/"
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
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}"),
|
apt::source { $fluentd::repo_name:
|
||||||
$release = $::lsbdistcodename,
|
location => $fluentd::repo_url,
|
||||||
$repos = 'contrib',
|
comment => $fluentd::repo_desc,
|
||||||
$key = {
|
repos => 'contrib',
|
||||||
'id' => 'C901622B5EC4AF820C38AB861093DB45A12E206F',
|
architecture => 'amd64',
|
||||||
'source' => 'https://packages.treasuredata.com/GPG-KEY-td-agent'
|
release => $fluentd::distro_codename,
|
||||||
|
key => {
|
||||||
|
id => $fluentd::repo_gpgkeyid,
|
||||||
|
source => $fluentd::repo_gpgkey,
|
||||||
|
},
|
||||||
|
include => {
|
||||||
|
'src' => false,
|
||||||
|
'deb' => true,
|
||||||
},
|
},
|
||||||
) {
|
|
||||||
|
|
||||||
include '::apt'
|
|
||||||
|
|
||||||
apt::source { 'treasure-data':
|
|
||||||
ensure => $ensure,
|
|
||||||
location => $location,
|
|
||||||
release => $release,
|
|
||||||
repos => $repos,
|
|
||||||
key => $key,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user