Puppet Class: profile::docker::prune

Defined in:
modules/profile/manifests/docker/prune.pp

Overview

SPDX-License-Identifier: Apache-2.0 Purge images on a weekly basis and dangling images daily to avoid filling up the disk

Parameters:

  • ensure (Wmflib::Ensure) (defaults to: lookup('docker::prune::ensure', { default_value => 'present' }))


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
# File 'modules/profile/manifests/docker/prune.pp', line 4

class profile::docker::prune(
    Wmflib::Ensure $ensure = lookup('docker::prune::ensure', { default_value => 'present' }),
) {
    systemd::timer::job { 'docker-system-prune-all':
        ensure      => $ensure,
        description => 'Prune all Docker images and volumes',
        user        => 'root',
        command     => '/usr/bin/docker system prune --all --volumes --force',
        splay       => 3600,  # seconds
        interval    => {
            'start'    => 'OnCalendar',
            'interval' => 'Sunday 3:00 UTC',
        },
    }

    systemd::timer::job { 'docker-system-prune-dangling':
        ensure      => $ensure,
        description => 'Prune dangling Docker images',
        user        => 'root',
        command     => '/usr/bin/docker system prune --force',
        splay       => 3600,  # seconds
        interval    => {
            'start'    => 'OnCalendar',
            'interval' => 'Mon-Sat 3:00 UTC',
        },
    }
}