Puppet Class: dockerinstall::registry::auth_token
- Inherits:
- dockerinstall::registry::params
- Defined in:
- manifests/registry/auth_token.pp
Summary
Enable integration of Registry into GitLab authentication mechanismOverview
Enable integration of Registry into GitLab authentication see docs.gitlab.com/ee/administration/packages/container_registry.html#enable-the-container-registry
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 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'manifests/registry/auth_token.pp', line 42
class dockerinstall::registry::auth_token (
Boolean $enable = false,
Boolean $gitlab = false,
Optional[Stdlib::Fqdn]
$realm_host = undef,
Optional[Stdlib::HTTPUrl]
$realm = undef,
Optional[String]
$realm_certificate = undef,
String $service = $dockerinstall::registry::params::auth_token_service,
String $issuer = $dockerinstall::registry::params::auth_token_issuer,
Boolean $registry_cert_export = true,
Boolean $token_map_export = true,
) inherits dockerinstall::registry::params
{
include dockerinstall::registry::setup::token
# auth:
# token:
# realm: https://gitlab1.domain.tld/jwt/auth
# service: container_registry
# issuer: omnibus-gitlab-issuer
# rootcertbundle: /var/opt/gitlab/registry/gitlab-registry.crt
# autoredirect: false
$rootcertbundle = $dockerinstall::registry::params::auth_token_rootcertbundle
if $enable {
if $gitlab {
unless $realm_host {
fail('You must supply realm_host parameter to dockerinstall::registry::auth_token (which is GitLab server name)')
}
$token_realm = "https://${realm_host}/jwt/auth"
if $registry_cert_export {
# export certificate from GitLab host realm_host
File <<| title == 'registry_rootcertbundle' and tag == $realm_host |>>
}
}
else {
unless $realm {
fail('You must supply auth_token_realm parameter to dockerinstall::registry::auth_token')
}
unless $realm_certificate {
fail('You must supply realm_certificate parameter to dockerinstall::registry::auth_token')
}
$token_realm = $realm
file { 'registry_rootcertbundle':
path => $rootcertbundle,
content => $realm_certificate,
}
}
if $token_map_export {
File <<| title == 'registry_tokens_map' and tag == $realm_host |>>
}
}
}
|