diff options
Diffstat (limited to 'roles/_workstation/pacman')
-rw-r--r-- | roles/_workstation/pacman/defaults/main.yml | 3 | ||||
-rw-r--r-- | roles/_workstation/pacman/tasks/main.yml | 20 | ||||
-rw-r--r-- | roles/_workstation/pacman/templates/paccache.hook.j2 | 11 |
3 files changed, 34 insertions, 0 deletions
diff --git a/roles/_workstation/pacman/defaults/main.yml b/roles/_workstation/pacman/defaults/main.yml new file mode 100644 index 0000000..8571f33 --- /dev/null +++ b/roles/_workstation/pacman/defaults/main.yml @@ -0,0 +1,3 @@ +--- + +pacman_hooks_dir: /etc/pacman.d/hooks diff --git a/roles/_workstation/pacman/tasks/main.yml b/roles/_workstation/pacman/tasks/main.yml new file mode 100644 index 0000000..7086eae --- /dev/null +++ b/roles/_workstation/pacman/tasks/main.yml @@ -0,0 +1,20 @@ +--- + +- name: install pacman-contrib + ansible.builtin.package: + name: pacman-contrib + state: present + +- name: create hooks directory + ansible.builtin.file: + path: "{{ pacman_hooks_dir }}" + state: directory + mode: "0755" + +- name: generate paccache hook + ansible.builtin.template: + src: paccache.hook.j2 + dest: "{{ pacman_hooks_dir }}/paccache.hook" + owner: 0 + group: 0 + mode: "0644" diff --git a/roles/_workstation/pacman/templates/paccache.hook.j2 b/roles/_workstation/pacman/templates/paccache.hook.j2 new file mode 100644 index 0000000..77b8f4e --- /dev/null +++ b/roles/_workstation/pacman/templates/paccache.hook.j2 @@ -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 -rvk2 |