Add podman container roles

This commit is contained in:
2019-12-28 20:07:15 -05:00
parent 0e5119bc6a
commit 8c8d1f9771
20 changed files with 581 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
---
- name: check if podman is installed
stat:
path: "{{ podman_path }}"
register: podman_binary
- name: mark podman being present
set_fact:
podman_present: present
when: podman_binary.stat.exists
- name: check if docker is installed
stat:
path: "{{ docker_path }}"
register: docker_binary
- name: mark docker being present
set_fact:
docker_present: present
when: docker_binary.stat.exists
- name: ensure periodic task to cleanup unused docker containers
cron:
name: "prune all docker images"
special_time: "{{ docker_prune_cronjob_special_time }}"
job: "{{ docker_path }} image prune {{ docker_prune_opts }} > /dev/null"
state: "{{ docker_present|default('absent') }}"
- name: ensure periodic task to cleanup unused podman containers
cron:
name: "prune all podman images"
special_time: "{{ podman_prune_cronjob_special_time }}"
job: "{{ podman_path }} system prune {{ podman_prune_opts }} > /dev/null"
state: "{{ podman_present|default('absent') }}"