added wrapper role

This commit is contained in:
Tobias Trabelsi 2021-12-22 22:23:42 +01:00
commit b71b53ac74
Signed by: lerentis
GPG Key ID: FF0C2839718CAF2E
8 changed files with 64 additions and 0 deletions

14
README.md Normal file
View File

@ -0,0 +1,14 @@
cri-o cleanup
=========
Removes unused images from host
Requirements
------------
cri-o needs to be installed and crictl needs to be available
License
-------
MIT

2
defaults/main.yml Normal file
View File

@ -0,0 +1,2 @@
---
# defaults file for crio-cleanup

2
handlers/main.yml Normal file
View File

@ -0,0 +1,2 @@
---
# handlers file for crio-cleanup

18
meta/main.yml Normal file
View File

@ -0,0 +1,18 @@
galaxy_info:
author: Tobias Trabelsi
description: removes unused OCI images from host
license: MIT
min_ansible_version: 2.9
platforms:
- name: CentOS
versions:
- 8
- 7
- name: Ubuntu
version:
- 16.04
- 18.04
- 20.04

19
tasks/main.yml Normal file
View File

@ -0,0 +1,19 @@
---
# tasks file for crio-cleanup
- name: "Check if cri-o is installed"
become: yes
package_facts:
manager: "auto"
tags: [ "cleanup", "prepare" ]
- name: fail if cri-o is not avaliable
fail:
msg: "crictl needs to be installed"
tags: [ "cleanup", "prepare" ]
- name: delete unused images
become: yes
command: "/usr/local/bin/crictl rmi --prune"
when: "'cri-o' in ansible_facts.packages"
tags: ["cleanup"]

2
tests/inventory Normal file
View File

@ -0,0 +1,2 @@
localhost

5
tests/test.yml Normal file
View File

@ -0,0 +1,5 @@
---
- hosts: localhost
remote_user: root
roles:
- crio-cleanup

2
vars/main.yml Normal file
View File

@ -0,0 +1,2 @@
---
# vars file for crio-cleanup