Puppet Class: hashi_stack::repo
- Defined in:
- manifests/repo.pp
Summary
Set up the package repository for the HashiCorp Stack componentsOverview
This class installs the hashicorp repository
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 |
# File 'manifests/repo.pp', line 24
class hashi_stack::repo (
Optional[Integer] $priority = undef,
String $proxy = 'absent',
String $key_id = '798AEC654E5C15428C8E42EEAA16FCBCA621E701',
Stdlib::HTTPSUrl $key_source = 'https://apt.releases.hashicorp.com/gpg',
String $description = 'HashiCorp package repository.',
String $rpm_base = 'https://rpm.releases.hashicorp.com',
Integer[0,1] $repo_gpgcheck = 0,
Integer[0,1] $repo_enabled = 1,
) {
$arch = $facts['os']['architecture'] ? {
'aarch64' => 'arm64', # 'aarch64' is official, but Hashicorp uses 'arm64'
default => $facts['os']['architecture'],
}
case $facts['os']['family'] {
'Debian': {
include apt
apt::source { 'HashiCorp':
ensure => 'present',
architecture => $arch,
comment => $description,
location => 'https://apt.releases.hashicorp.com',
repos => 'main',
key => {
'id' => $key_id,
'source' => $key_source,
},
include => {
'deb' => true,
'src' => false,
},
pin => $priority,
}
}
'RedHat': {
yumrepo { 'HashiCorp':
descr => $description,
baseurl => "${rpm_base}/RHEL/\$releasever/\$basearch/stable",
gpgcheck => 1,
gpgkey => $key_source,
repo_gpgcheck => $repo_gpgcheck,
enabled => $repo_enabled,
proxy => $proxy,
priority => $priority,
}
}
default: {
fail("\"${module_name}\" provides no repository information for OSfamily \"${facts['os']['family']}\"")
}
}
}
|