mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Decoupeld database, docker and proxy
This commit is contained in:
43
roles/docker-core/Administration.md
Normal file
43
roles/docker-core/Administration.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# Administration 🛠️
|
||||
|
||||
## List Unused Volumes
|
||||
```bash
|
||||
docker volume ls -q -f "dangling=true"
|
||||
```
|
||||
|
||||
## Remove All Unused Volumes
|
||||
```bash
|
||||
docker volume rm $(docker volume ls -q -f "dangling=true")
|
||||
```
|
||||
|
||||
## Network Issues Fixes
|
||||
```bash
|
||||
docker stop $(docker ps -a -q)
|
||||
docker rm $(docker ps -a -q)
|
||||
docker network prune -f
|
||||
systemctl stop docker
|
||||
rm -fv /var/lib/docker/network/files/local-kv.db
|
||||
systemctl start docker
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
# Warning ⚠️
|
||||
|
||||
**Caution:** The following instructions will delete **all Docker containers and volumes** on your server.
|
||||
Make sure you have backups or that you're certain you want to clean your Docker environment completely.
|
||||
|
||||
---
|
||||
|
||||
## Cleaning Up Docker Containers and Volumes 🧹
|
||||
|
||||
### Delete All Docker Containers
|
||||
```bash
|
||||
docker stop $(docker ps -a -q)
|
||||
docker rm $(docker ps -a -q)
|
||||
```
|
||||
|
||||
### Delete All Docker Volumes
|
||||
```bash
|
||||
docker volume rm $(docker volume ls -q)
|
||||
```
|
5
roles/docker-core/README.md
Normal file
5
roles/docker-core/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Docker Server
|
||||
|
||||
This role is part of the [CyMaIS Project](https://github.com/kevinveenbirkenbach/cymais), maintained and developed by [Kevin Veen-Birkenbach](https://www.veen.world/).
|
||||
|
||||
Enjoy using this role and happy containerizing! 🎉
|
3
roles/docker-core/handlers/main.yml
Normal file
3
roles/docker-core/handlers/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- name: docker restart
|
||||
service: name=docker.service state=restarted enabled=yes
|
35
roles/docker-core/meta/main.yml
Normal file
35
roles/docker-core/meta/main.yml
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
galaxy_info:
|
||||
author: "Kevin Veen-Birkenbach"
|
||||
description: >
|
||||
Installs and maintains Docker.
|
||||
license: "CyMaIS NonCommercial License (CNCL)"
|
||||
license_url: "https://s.veen.world/cncl"
|
||||
company: |
|
||||
Kevin Veen-Birkenbach
|
||||
Consulting & Coaching Solutions
|
||||
https://www.veen.world
|
||||
min_ansible_version: "2.9"
|
||||
platforms:
|
||||
- name: Linux
|
||||
versions:
|
||||
- all
|
||||
galaxy_tags:
|
||||
- docker
|
||||
- container
|
||||
- infrastructure
|
||||
- automation
|
||||
- cleanup
|
||||
- linux
|
||||
- system
|
||||
repository: "https://s.veen.world/cymais"
|
||||
issue_tracker_url: "https://s.veen.world/cymaisissues"
|
||||
documentation: "https://s.veen.world/cymais/docker"
|
||||
|
||||
dependencies:
|
||||
- bkp-docker-to-local
|
||||
- user-administrator
|
||||
- mon-bot-docker-container
|
||||
- mon-bot-docker-volumes
|
||||
- maint-docker-heal
|
||||
- maint-docker-restart
|
31
roles/docker-core/tasks/main.yml
Normal file
31
roles/docker-core/tasks/main.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
|
||||
- name: docker & docker compose install
|
||||
pacman:
|
||||
name: ['docker','docker-compose']
|
||||
state: present
|
||||
notify: docker restart
|
||||
when: run_once_docker is not defined
|
||||
|
||||
- name: "create {{path_docker_compose_instances}}"
|
||||
file:
|
||||
path: "{{path_docker_compose_instances}}"
|
||||
state: directory
|
||||
mode: 0700
|
||||
owner: administrator
|
||||
group: administrator
|
||||
when: run_once_docker is not defined
|
||||
|
||||
- name: Set docker_enabled to true, to activate maint-docker-storage-optimizer
|
||||
set_fact:
|
||||
docker_enabled: true
|
||||
when: run_once_docker is not defined
|
||||
|
||||
- name: flush docker service
|
||||
meta: flush_handlers
|
||||
when: run_once_docker is not defined
|
||||
|
||||
- name: run the docker tasks once
|
||||
set_fact:
|
||||
run_once_docker: true
|
||||
when: run_once_docker is not defined
|
Reference in New Issue
Block a user