mirror of
https://github.com/krislamo/puppet-fluentd
synced 2025-09-07 23:09:30 +00:00
added fluentd::repo & fluentd::repo::apt
This commit is contained in:
@@ -42,7 +42,16 @@
|
||||
#
|
||||
# Copyright 2015 Your name here, unless otherwise noted.
|
||||
#
|
||||
class fluentd {
|
||||
class fluentd (
|
||||
$ensure = $::fluentd::params::ensure,
|
||||
$manage_repo = $::fluentd::params::manage_repo,
|
||||
) inherits fluentd::params {
|
||||
|
||||
validate_string($ensure)
|
||||
validate_bool($manage_repo)
|
||||
|
||||
if $manage_repo {
|
||||
class { '::fluentd::repo': }
|
||||
}
|
||||
|
||||
}
|
||||
|
19
manifests/params.pp
Normal file
19
manifests/params.pp
Normal file
@@ -0,0 +1,19 @@
|
||||
class fluentd::params {
|
||||
$ensure = 'present'
|
||||
|
||||
case $::osfamily {
|
||||
'Debian': {
|
||||
case $::operatingsystem {
|
||||
'Ubuntu': {
|
||||
$manage_repo = true
|
||||
}
|
||||
default: {
|
||||
fail("Unsupported osfamily: ${::operatingsystem}")
|
||||
}
|
||||
}
|
||||
}
|
||||
default: {
|
||||
fail("Unsupported osfamily: ${::osfamily}")
|
||||
}
|
||||
}
|
||||
}
|
12
manifests/repo.pp
Normal file
12
manifests/repo.pp
Normal file
@@ -0,0 +1,12 @@
|
||||
# Configure package repository
|
||||
#
|
||||
class fluentd::repo {
|
||||
case $::osfamily {
|
||||
'Debian': {
|
||||
include ::fluentd::repo::apt
|
||||
}
|
||||
default: {
|
||||
fail("No repo available for ${::osfamily}/${::operatingsystem}")
|
||||
}
|
||||
}
|
||||
}
|
20
manifests/repo/apt.pp
Normal file
20
manifests/repo/apt.pp
Normal file
@@ -0,0 +1,20 @@
|
||||
# Configure apt::source
|
||||
#
|
||||
class fluentd::repo::apt (
|
||||
$ensure = 'present',
|
||||
$location = downcase("http://packages.treasuredata.com/2/${::operatingsystem}/${::lsbdistcodename}"),
|
||||
$release = $::lsbdistcodename,
|
||||
$repos = 'contrib',
|
||||
$key_source = 'https://packages.treasuredata.com/GPG-KEY-td-agent',
|
||||
) {
|
||||
|
||||
include '::apt'
|
||||
|
||||
apt::source { 'treasure-data':
|
||||
ensure => $ensure,
|
||||
location => $location,
|
||||
release => $release,
|
||||
repos => $repos,
|
||||
key_source => $key_source,
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user