aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/roles
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-03-17 10:23:17 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2022-03-17 10:23:17 +0300
commit8da4a03a97dc8bf2d658137c1304d851a992574b (patch)
treee65ecf21410a4f610dd379ecd6af1b47b3323bdc /roles
parentroles: my-server -> my_server (diff)
downloadmaintenance-8da4a03a97dc8bf2d658137c1304d851a992574b.tar.gz
maintenance-8da4a03a97dc8bf2d658137c1304d851a992574b.zip
roles: add yay
Diffstat (limited to 'roles')
-rw-r--r--roles/yay/meta/main.yml2
-rw-r--r--roles/yay/tasks/main.yml23
2 files changed, 25 insertions, 0 deletions
diff --git a/roles/yay/meta/main.yml b/roles/yay/meta/main.yml
new file mode 100644
index 0000000..99c8bbf
--- /dev/null
+++ b/roles/yay/meta/main.yml
@@ -0,0 +1,2 @@
+dependencies:
+ - role: pacman
diff --git a/roles/yay/tasks/main.yml b/roles/yay/tasks/main.yml
new file mode 100644
index 0000000..49356c7
--- /dev/null
+++ b/roles/yay/tasks/main.yml
@@ -0,0 +1,23 @@
+- name: Check if yay is installed
+ command: yay --version
+ register: yay_version
+ changed_when: no
+ failed_when: no
+
+- when: yay_version.rc == 0
+ block:
+ - name: Upgrade packages
+ kewlfft.aur.aur:
+ use: yay
+ update_cache: yes
+ upgrade: yes
+ aur_only: yes
+ register: yay_result
+ notify: reboot
+
+ - debug:
+ var: yay_result
+ when: yay_result
+
+ - name: Flush handlers
+ meta: flush_handlers