Puppet Class: docker_registry_ha

Defined in:
modules/docker_registry_ha/manifests/init.pp

Overview

Parameters:

  • swift_user (String)
  • swift_password (String)
  • swift_url (Stdlib::Httpurl)
  • swift_container (String)
  • redis_host (Stdlib::Host)
  • redis_port (Stdlib::Port::Unprivileged)
  • redis_passwd (String)
  • registry_shared_secret (String)


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'modules/docker_registry_ha/manifests/init.pp', line 1

class docker_registry_ha (
    String $swift_user,
    String $swift_password,
    Stdlib::Httpurl $swift_url,
    String $swift_container,
    Stdlib::Host $redis_host,
    Stdlib::Port::Unprivileged $redis_port,
    String $redis_passwd,
    String $registry_shared_secret
){



    # the required docker-registry version (2.7.0) is not available for jessie
    # so you cannot install this module on jessie.
    requires_os('debian > jessie')

    # this could be removed when buster or next debian includes a 2.7+ version
    apt::pin { 'strech_wikimedia_docker_registry_27':
        package  => 'docker-registry',
        pin      => 'version 2.7.0~rc0~wmf1-1',
        priority => '1002',
    }

    package {'docker-registry':
        ensure => present,
    }

    file { '/etc/docker/registry/config.yml':
        content => template('docker_registry_ha/registry-ha-config.yaml.erb'),
        owner   => 'docker-registry',
        group   => 'docker-registry',
        mode    => '0440',
        notify  => Service['docker-registry'],
    }

    service { 'docker-registry':
        ensure  => running,
        require => File[
            '/etc/docker/registry/config.yml'
        ],
    }
}