From b465108fcc3a0312f1118aaa66e17be314d41e58 Mon Sep 17 00:00:00 2001 From: ume3 Date: Tue, 26 Jan 2016 18:07:01 +0900 Subject: [PATCH] added redhat(yumrepo) support Check CentOS7.2(1511) / Redhat7.1 refs - https://td-agent-package-browser.herokuapp.com/2/redhat/ - http://docs.puppetlabs.com/puppet/latest/reference/type.html#yumrepo --- manifests/params.pp | 3 +++ manifests/repo.pp | 3 +++ manifests/repo/yum.pp | 25 +++++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 manifests/repo/yum.pp diff --git a/manifests/params.pp b/manifests/params.pp index 08a9455..eb43e22 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -22,6 +22,9 @@ class fluentd::params { 'Debian': { $repo_manage = true } + 'Redhat': { + $repo_manage = true + } default: { fail("Unsupported osfamily: ${::osfamily}") } diff --git a/manifests/repo.pp b/manifests/repo.pp index ba4d73d..1efc365 100644 --- a/manifests/repo.pp +++ b/manifests/repo.pp @@ -6,6 +6,9 @@ class fluentd::repo inherits fluentd { 'Debian': { include ::fluentd::repo::apt } + 'RedHat': { + include ::fluentd::repo::yum + } default: { fail("No repo available for ${::osfamily}/${::operatingsystem}") } diff --git a/manifests/repo/yum.pp b/manifests/repo/yum.pp new file mode 100644 index 0000000..d002376 --- /dev/null +++ b/manifests/repo/yum.pp @@ -0,0 +1,25 @@ +# Configure yumrepo +# +class fluentd::repo::yum ( + $descr = 'TreasureData', + $baseurl = 'https://packages.treasuredata.com/2/redhat/$releasever/$basearch', + $enabled = '1', + $gpgcheck = '1', + $gpgkey = 'https://packages.treasuredata.com/GPG-KEY-td-agent', +) { + + include '::yumrepo' + + yumrepo { 'treasure-data': + descr => $descr, + baseurl => $baseurl, + enabled => $enabled, + gpgcheck => $gpgcheck, + notify => Exec['add GPG key'], + } + + exec { 'add GPG key': + command => "/usr/bin/rpm --import ${fluentd::repo::yum::gpgkey}", + refreshonly => true, + } +}