X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Felasticsearch%2Fmanifests%2Frepo.pp;fp=3rdparty%2Fmodules%2Felasticsearch%2Fmanifests%2Frepo.pp;h=326652d99a3f737570f52d6fc3dd7ab0d815bca0;hb=47e66c55978a019774cdbfa777be7bbcec325863;hp=0000000000000000000000000000000000000000;hpb=451142c0730ffe4c1ea13089f3972e9660cb2465;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/elasticsearch/manifests/repo.pp b/3rdparty/modules/elasticsearch/manifests/repo.pp new file mode 100644 index 000000000..326652d99 --- /dev/null +++ b/3rdparty/modules/elasticsearch/manifests/repo.pp @@ -0,0 +1,78 @@ +# == Class: elasticsearch::repo +# +# This class exists to install and manage yum and apt repositories +# that contain elasticsearch official elasticsearch packages +# +# +# === Parameters +# +# This class does not provide any parameters. +# +# +# === Examples +# +# This class may be imported by other classes to use its functionality: +# class { 'elasticsearch::repo': } +# +# It is not intended to be used directly by external resources like node +# definitions or other modules. +# +# +# === Authors +# +# * Phil Fenstermacher +# * Richard Pijnenburg +# +class elasticsearch::repo { + + Exec { + path => [ '/bin', '/usr/bin', '/usr/local/bin' ], + cwd => '/', + } + + case $::osfamily { + 'Debian': { + if !defined(Class['apt']) { + class { 'apt': } + } + + apt::source { 'elasticsearch': + location => "http://packages.elasticsearch.org/elasticsearch/${elasticsearch::repo_version}/debian", + release => 'stable', + repos => 'main', + key => 'D88E42B4', + key_source => 'http://packages.elasticsearch.org/GPG-KEY-elasticsearch', + include_src => false, + } + } + 'RedHat', 'Linux': { + yumrepo { 'elasticsearch': + descr => 'elasticsearch repo', + baseurl => "http://packages.elasticsearch.org/elasticsearch/${elasticsearch::repo_version}/centos", + gpgcheck => 1, + gpgkey => 'http://packages.elasticsearch.org/GPG-KEY-elasticsearch', + enabled => 1, + } + } + 'Suse': { + exec { 'elasticsearch_suse_import_gpg': + command => 'rpmkeys --import http://packages.elasticsearch.org/GPG-KEY-elasticsearch', + unless => 'test $(rpm -qa gpg-pubkey | grep -i "D88E42B4" | wc -l) -eq 1 ', + notify => [ Zypprepo['elasticsearch'] ] + } + + zypprepo { 'elasticsearch': + baseurl => "http://packages.elasticsearch.org/elasticsearch/${elasticsearch::repo_version}/centos", + enabled => 1, + autorefresh => 1, + name => 'elasticsearch', + gpgcheck => 1, + gpgkey => 'http://packages.elasticsearch.org/GPG-KEY-elasticsearch', + type => 'yum' + } + } + default: { + fail("\"${module_name}\" provides no repository information for OSfamily \"${::osfamily}\"") + } + } +}