summaryrefslogtreecommitdiff
path: root/roles/pacman
diff options
context:
space:
mode:
Diffstat (limited to 'roles/pacman')
-rw-r--r--roles/pacman/handlers/main.yml3
-rw-r--r--roles/pacman/tasks/main.yml8
2 files changed, 11 insertions, 0 deletions
diff --git a/roles/pacman/handlers/main.yml b/roles/pacman/handlers/main.yml
new file mode 100644
index 0000000..575536d
--- /dev/null
+++ b/roles/pacman/handlers/main.yml
@@ -0,0 +1,3 @@
+- name: Update packages db
+ community.general.pacman:
+ update_cache: true
diff --git a/roles/pacman/tasks/main.yml b/roles/pacman/tasks/main.yml
index e7c9a9a..87f4cab 100644
--- a/roles/pacman/tasks/main.yml
+++ b/roles/pacman/tasks/main.yml
@@ -15,8 +15,16 @@
owner: root
group: root
mode: u+rw,g+r,o+r
+ notify:
+ - Update packages db
loop:
- regexp: '^[misc]'
line: '[misc]'
- regexp: '^Include = /etc/pacman.d/misc'
line: 'Include = /etc/pacman.d/misc'
+
+# Usually, handlers run after all tasks are completed, but it doesn't work for
+# this case, because we are going to install package from misc repository, so
+# we need to have package db up to date.
+- name: Force packages db update
+ ansible.builtin.meta: flush_handlers