Puppet Class: cassandra::apache_repo
- Defined in:
- manifests/apache_repo.pp
Overview
An optional class that will allow a suitable repository to be configured from which packages for Apache Cassandra can be downloaded.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'manifests/apache_repo.pp', line 23
class cassandra::apache_repo (
$descr = 'Repo for Apache Cassandra',
$key_id = 'A26E528B271F19B9E5D8E19EA278B781FE4B2BDA',
$key_url = 'https://www.apache.org/dist/cassandra/KEYS',
$pkg_url = undef,
$release = 'main',
) {
case $facts['os']['family'] {
'RedHat': {
if $pkg_url != undef {
$baseurl = $pkg_url
} else {
$url = 'http://www.apache.org/dist/cassandra/redhat'
$baseurl = "${url}/${release}"
}
yumrepo { 'cassandra_apache':
ensure => present,
descr => $descr,
baseurl => $baseurl,
enabled => 1,
gpgcheck => 1,
gpgkey => $key_url,
}
}
'Debian': {
include apt
include apt::update
apt::key { 'apache.cassandra':
id => $key_id,
source => $key_url,
before => Apt::Source['cassandra.sources'],
}
if $pkg_url != undef {
$location = $pkg_url
} else {
$location = 'http://www.apache.org/dist/cassandra/debian'
}
apt::source { 'cassandra.sources':
location => $location,
comment => $descr,
release => $release,
include => {
'src' => false,
},
notify => Exec['update-apache-cassandra-repo'],
}
# Required to wrap apt_update
exec { 'update-apache-cassandra-repo':
refreshonly => true,
command => '/bin/true',
require => Exec['apt_update'],
}
}
default: {
warning("OS family ${facts['os']['family']} not supported")
}
}
}
|