added wrapper role
This commit is contained in:
		
							
								
								
									
										14
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								README.md
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										2
									
								
								defaults/main.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
---
 | 
			
		||||
# defaults file for crio-cleanup
 | 
			
		||||
							
								
								
									
										2
									
								
								handlers/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								handlers/main.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
---
 | 
			
		||||
# handlers file for crio-cleanup
 | 
			
		||||
							
								
								
									
										18
									
								
								meta/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								meta/main.yml
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										19
									
								
								tasks/main.yml
									
									
									
									
									
										Normal 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
									
								
							
							
						
						
									
										2
									
								
								tests/inventory
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
localhost
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										5
									
								
								tests/test.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								tests/test.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
---
 | 
			
		||||
- hosts: localhost
 | 
			
		||||
  remote_user: root
 | 
			
		||||
  roles:
 | 
			
		||||
    - crio-cleanup
 | 
			
		||||
							
								
								
									
										2
									
								
								vars/main.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								vars/main.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
---
 | 
			
		||||
# vars file for crio-cleanup
 | 
			
		||||
		Reference in New Issue
	
	Block a user