Clear pacman cache
This commit is contained in:
parent
77e83fec6d
commit
330e7e9305
3 changed files with 31 additions and 0 deletions
|
@ -3,6 +3,8 @@
|
||||||
- base
|
- base
|
||||||
- role: realorangeone.reflector
|
- role: realorangeone.reflector
|
||||||
when: ansible_os_family == 'Archlinux'
|
when: ansible_os_family == 'Archlinux'
|
||||||
|
- role: paccache
|
||||||
|
when: ansible_os_family == 'Archlinux'
|
||||||
|
|
||||||
- hosts: casey
|
- hosts: casey
|
||||||
roles:
|
roles:
|
||||||
|
|
11
ansible/roles/paccache/files/paccache.hook
Normal file
11
ansible/roles/paccache/files/paccache.hook
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
[Trigger]
|
||||||
|
Operation = Upgrade
|
||||||
|
Operation = Install
|
||||||
|
Operation = Remove
|
||||||
|
Type = Package
|
||||||
|
Target = *
|
||||||
|
|
||||||
|
[Action]
|
||||||
|
Description = Cleaning pacman cache...
|
||||||
|
When = PostTransaction
|
||||||
|
Exec = /usr/bin/paccache -r
|
18
ansible/roles/paccache/tasks/main.yml
Normal file
18
ansible/roles/paccache/tasks/main.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
- name: Install Pacman utils
|
||||||
|
package:
|
||||||
|
name: pacman-contrib
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Create hooks directory
|
||||||
|
file:
|
||||||
|
path: /etc/pacman.d/hooks/
|
||||||
|
state: directory
|
||||||
|
mode: "0755"
|
||||||
|
become: true
|
||||||
|
|
||||||
|
- name: Install pacman hook
|
||||||
|
template:
|
||||||
|
src: files/paccache.hook
|
||||||
|
dest: /etc/pacman.d/hooks/clean_package_cache.hook
|
||||||
|
mode: "0644"
|
||||||
|
become: true
|
Loading…
Reference in a new issue