From 8da4a03a97dc8bf2d658137c1304d851a992574b Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 17 Mar 2022 10:23:17 +0300 Subject: roles: add yay --- maintenance.yml | 1 + requirements.yml | 3 +++ roles/yay/meta/main.yml | 2 ++ roles/yay/tasks/main.yml | 23 +++++++++++++++++++++++ 4 files changed, 29 insertions(+) create mode 100644 roles/yay/meta/main.yml create mode 100644 roles/yay/tasks/main.yml diff --git a/maintenance.yml b/maintenance.yml index 9006e68..a9df5e0 100644 --- a/maintenance.yml +++ b/maintenance.yml @@ -4,6 +4,7 @@ - snap - apt - pacman + - yay - my_server - docker - flatpak diff --git a/requirements.yml b/requirements.yml index 1b17a8a..5ca5805 100644 --- a/requirements.yml +++ b/requirements.yml @@ -6,3 +6,6 @@ collections: # https://github.com/ansible-collections/community.general/commit/b9f62bb4ef7808c0220d154c10c1c846f7c3361e - name: community.general version: 4.6.0 + # Yay-compatible module: + - name: kewlfft.aur + version: 0.10.0 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 -- cgit v1.2.3