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

added fluentd::repo & fluentd::repo::apt

This commit is contained in:
Max Wilhelm 2015-11-30 15:18:26 +01:00
parent 3f09afb262
commit 6463a84e2b
5 changed files with 63 additions and 2 deletions

View File

@ -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
View 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
View 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
View 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,
}
}

View File

@ -8,7 +8,8 @@
"project_page": "https://github.com/wywygmbh/puppet-fluentd",
"issues_url": "https://github.com/wywygmbh/puppet-fluentd/issues",
"dependencies": [
{"name":"puppetlabs-stdlib","version_requirement":">= 1.0.0"}
{ "name":"puppetlabs-stdlib","version_requirement":">= 1.0.0" },
{ "name": "puppetlabs/apt", "version_requirement": ">= 1.8.0 < 3.0.0" }
],
"data_provider": null
}