docker-cleanup: Add role to prune old images

This commit is contained in:
saibotk 2020-08-15 21:30:33 +02:00
parent cb6f8b1865
commit 95730a6a96
No known key found for this signature in database
GPG key ID: A3299C587D5DF523
17 changed files with 79 additions and 0 deletions

View file

@ -21,6 +21,7 @@
roles:
- docker
- docker-compose
- docker-cleanup
- traefik
- camo
environment:

View file

@ -20,6 +20,7 @@
roles:
- docker
- docker-compose
- docker-cleanup
- traefik
- codimd
environment:

View file

@ -20,6 +20,7 @@
roles:
- docker
- docker-compose
- docker-cleanup
- docker-ipv6-nat
environment:
PYTHONPATH: /opt/python2/ansible-dependencies/lib/python2.7/site-packages

View file

@ -21,6 +21,7 @@
roles:
- docker
- docker-compose
- docker-cleanup
- gitlab-runner
environment:
PYTHONPATH: /opt/python2/ansible-dependencies/lib/python2.7/site-packages

View file

@ -21,6 +21,7 @@
roles:
- docker
- docker-compose
- docker-cleanup
- traefik
- gitlab
environment:

View file

@ -21,6 +21,7 @@
roles:
- docker
- docker-compose
- docker-cleanup
- traefik
- keycloak
environment:

View file

@ -21,6 +21,7 @@
roles:
- docker
- docker-compose
- docker-cleanup
- traefik
- mastodon
environment:

View file

@ -20,6 +20,7 @@
roles:
- docker
- docker-compose
- docker-cleanup
- traefik
- minecraft-blockmap
environment:

View file

@ -21,6 +21,7 @@
roles:
- docker
- docker-compose
- docker-cleanup
- minecraft
environment:
PYTHONPATH: /opt/python2/ansible-dependencies/lib/python2.7/site-packages

View file

@ -21,6 +21,7 @@
roles:
- docker
- docker-compose
- docker-cleanup
- traefik
- minio
environment:

View file

@ -21,6 +21,7 @@
roles:
- docker
- docker-compose
- docker-cleanup
- traefik
- monitoring
environment:
@ -30,6 +31,7 @@
roles:
- docker
- docker-compose
- docker-cleanup
- telegraf
environment:
PYTHONPATH: /opt/python2/ansible-dependencies/lib/python2.7/site-packages

View file

@ -0,0 +1,24 @@
docker-cleanup
=========
This will prune unused docker images older than 3 days, to keep the system clean.
Requirements
------------
You will need to have docker installed with its python package to use this role.
Role Variables
--------------
None
Dependencies
------------
- docker
License
-------
GPL-3.0-only

View file

@ -0,0 +1,15 @@
galaxy_info:
author: Christoph Kern
description: Cleans up the exsting docker install
license: GPL-3.0-only
min_ansible_version: 2.4
platforms:
- name: CentOS
versions:
- 7
galaxy_tags: []
dependencies: []

View file

@ -0,0 +1,25 @@
---
# Infrastructure
# Ansible instructions to deploy the infrastructure
# Copyright (C) 2019-2020 Christoph (Sheogorath) Kern
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
- name: Prune docker images older than 3 days
docker_prune:
images: yes
images_filters:
dangling: false
until: 72h
become: true

View file

@ -22,6 +22,7 @@
roles:
- docker
- docker-compose
- docker-cleanup
- traefik
- static_websites
environment:

View file

@ -20,6 +20,7 @@
roles:
- docker
- docker-compose
- docker-cleanup
- teamspeak
environment:
PYTHONPATH: /opt/python2/ansible-dependencies/lib/python2.7/site-packages

View file

@ -20,6 +20,7 @@
roles:
- docker
- docker-compose
- docker-cleanup
- traefik
environment:
PYTHONPATH: /opt/python2/ansible-dependencies/lib/python2.7/site-packages