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: roles:
- docker - docker
- docker-compose - docker-compose
- docker-cleanup
- traefik - traefik
- camo - camo
environment: environment:

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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