diff --git a/roles/rkt/files/rkt-gc.sh b/roles/rkt/files/rkt-gc.sh new file mode 100644 index 000000000..e260668cf --- /dev/null +++ b/roles/rkt/files/rkt-gc.sh @@ -0,0 +1,2 @@ +#!/bin/bash +rkt gc diff --git a/roles/rkt/tasks/main.yml b/roles/rkt/tasks/main.yml index d84a2165d..00f9e79c4 100644 --- a/roles/rkt/tasks/main.yml +++ b/roles/rkt/tasks/main.yml @@ -1,5 +1,13 @@ --- - - name: Install rkt import_tasks: install.yml when: not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] + +- name: Set up cron job to do garbage cleanup + copy: + src: rkt-gc.sh + dest: /etc/cron.hourly/rkt-gc.sh + owner: root + group: root + mode: 0750 + when: not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]