Puppet Class: profile::local_dev::docker_publish

Defined in:
modules/profile/manifests/local_dev/docker_publish.pp

Overview

Class profile::local_dev::docker_publish

Apparatus for publishing dev-images Docker images for local-charts.

Parameters

registry

URI of a docker registry.

username

User with rights to push to that registry.

password

Password for user provided by private puppet.

http_proxy

HTTP proxy (if needed).

Parameters:

  • registry (Stdlib::Host) (defaults to: lookup('docker::registry'))
  • password (String) (defaults to: lookup('profile::local_dev::ci_build_user_password'))
  • http_proxy (Optional[Stdlib::Httpurl]) (defaults to: lookup('http_proxy', {'default_value' => undef}))


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
44
45
46
47
48
49
50
51
# File 'modules/profile/manifests/local_dev/docker_publish.pp', line 19

class profile::local_dev::docker_publish(
    Stdlib::Host $registry = lookup('docker::registry'),
    String $password = lookup('profile::local_dev::ci_build_user_password'),
    Optional[Stdlib::Httpurl] $http_proxy = lookup('http_proxy', {'default_value' => undef})
){

    # The sudo rule granted in modules/admin/data/data.yaml
    $builder_user = 'dockerpkg-builder'
    $builder_group = 'contint-admins'

    user { $builder_user:
        ensure => present,
        gid    => $builder_group,
        system => true,
        home   => '/nonexistent',
        shell  => '/usr/sbin/nologin',
    }

    git::clone { 'releng/dev-images':
        directory => '/srv/dev-images',
        owner     => $builder_user,
        group     => $builder_group,
        origin    => 'https://gitlab.wikimedia.org/releng/dev-images.git',
    }

    file { '/etc/docker-pkg/dev-images.yaml':
        ensure  => present,
        content => template('profile/local_dev/docker-pkg-dev-images.yaml.erb'),
        owner   => 'root',
        group   => $builder_group,
        mode    => '0440'
    }
}