docker-cleanup: Add role to prune old images
This commit is contained in:
parent
cb6f8b1865
commit
95730a6a96
17 changed files with 79 additions and 0 deletions
1
camo.yml
1
camo.yml
|
@ -21,6 +21,7 @@
|
||||||
roles:
|
roles:
|
||||||
- docker
|
- docker
|
||||||
- docker-compose
|
- docker-compose
|
||||||
|
- docker-cleanup
|
||||||
- traefik
|
- traefik
|
||||||
- camo
|
- camo
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
roles:
|
roles:
|
||||||
- docker
|
- docker
|
||||||
- docker-compose
|
- docker-compose
|
||||||
|
- docker-cleanup
|
||||||
- traefik
|
- traefik
|
||||||
- codimd
|
- codimd
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
roles:
|
roles:
|
||||||
- docker
|
- docker
|
||||||
- docker-compose
|
- docker-compose
|
||||||
|
- docker-cleanup
|
||||||
- traefik
|
- traefik
|
||||||
- gitlab
|
- gitlab
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
roles:
|
roles:
|
||||||
- docker
|
- docker
|
||||||
- docker-compose
|
- docker-compose
|
||||||
|
- docker-cleanup
|
||||||
- traefik
|
- traefik
|
||||||
- keycloak
|
- keycloak
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
roles:
|
roles:
|
||||||
- docker
|
- docker
|
||||||
- docker-compose
|
- docker-compose
|
||||||
|
- docker-cleanup
|
||||||
- traefik
|
- traefik
|
||||||
- mastodon
|
- mastodon
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
roles:
|
roles:
|
||||||
- docker
|
- docker
|
||||||
- docker-compose
|
- docker-compose
|
||||||
|
- docker-cleanup
|
||||||
- traefik
|
- traefik
|
||||||
- minecraft-blockmap
|
- minecraft-blockmap
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
roles:
|
roles:
|
||||||
- docker
|
- docker
|
||||||
- docker-compose
|
- docker-compose
|
||||||
|
- docker-cleanup
|
||||||
- traefik
|
- traefik
|
||||||
- minio
|
- minio
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -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
|
||||||
|
|
24
roles/docker-cleanup/README.md
Normal file
24
roles/docker-cleanup/README.md
Normal 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
|
15
roles/docker-cleanup/meta/main.yml
Normal file
15
roles/docker-cleanup/meta/main.yml
Normal 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: []
|
25
roles/docker-cleanup/tasks/main.yml
Normal file
25
roles/docker-cleanup/tasks/main.yml
Normal 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
|
|
@ -22,6 +22,7 @@
|
||||||
roles:
|
roles:
|
||||||
- docker
|
- docker
|
||||||
- docker-compose
|
- docker-compose
|
||||||
|
- docker-cleanup
|
||||||
- traefik
|
- traefik
|
||||||
- static_websites
|
- static_websites
|
||||||
environment:
|
environment:
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue