summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.yml1
-rw-r--r--molecule/archlinux/converge.yml1
-rw-r--r--roles/yay/meta/argument_specs.yml6
-rw-r--r--roles/yay/meta/main.yml13
-rw-r--r--roles/yay/tasks/main.yml37
5 files changed, 58 insertions, 0 deletions
diff --git a/configure.yml b/configure.yml
index 0393c55d..7619647b 100644
--- a/configure.yml
+++ b/configure.yml
@@ -23,6 +23,7 @@
- role: "vim"
- role: "neomutt"
- role: "firefox"
+ - role: "yay"
- name: "Ubuntu configure"
gather_facts: true
diff --git a/molecule/archlinux/converge.yml b/molecule/archlinux/converge.yml
index 10edc00d..dc4bd3c3 100644
--- a/molecule/archlinux/converge.yml
+++ b/molecule/archlinux/converge.yml
@@ -31,6 +31,7 @@
- role: "password_policy"
- role: "locales"
- role: "timezone"
+ - role: "yay"
- role: "wireguard"
- role: "gateway"
- role: "python"
diff --git a/roles/yay/meta/argument_specs.yml b/roles/yay/meta/argument_specs.yml
new file mode 100644
index 00000000..96aca0ec
--- /dev/null
+++ b/roles/yay/meta/argument_specs.yml
@@ -0,0 +1,6 @@
+---
+argument_specs:
+ main:
+ short_description: "Install yay AUR helper on ArchLinux"
+ description: "Install yay AUR helper on ArchLinux"
+ options: {}
diff --git a/roles/yay/meta/main.yml b/roles/yay/meta/main.yml
new file mode 100644
index 00000000..69b13d28
--- /dev/null
+++ b/roles/yay/meta/main.yml
@@ -0,0 +1,13 @@
+---
+dependencies:
+ - role: "git"
+galaxy_info:
+ author: "a14m"
+ description: "Install yay AUR helper on ArchLinux"
+ company: "kartoffeln.work GmbH."
+ license: "MIT"
+ min_ansible_version: "2.18"
+ platforms:
+ - name: "ArchLinux"
+ versions:
+ - "all"
diff --git a/roles/yay/tasks/main.yml b/roles/yay/tasks/main.yml
new file mode 100644
index 00000000..b9d0ff5f
--- /dev/null
+++ b/roles/yay/tasks/main.yml
@@ -0,0 +1,37 @@
+---
+- name: "Ensure base-devel is installed"
+ become: true
+ ansible.builtin.package:
+ name: "base-devel"
+ state: "present"
+
+- name: "Check if yay exists"
+ ansible.builtin.stat:
+ path: "/usr/bin/yay"
+ register: yay_binary
+
+- name: "Install yay"
+ when: not yay_binary.stat.exists
+ block:
+ - name: "Clone yay-bin"
+ ansible.builtin.git:
+ repo: "https://aur.archlinux.org/yay-bin.git"
+ dest: "/tmp/yay-bin"
+ clone: true
+ update: false
+ single_branch: true
+ version: "master"
+
+ - name: "Build yay-bin"
+ ansible.builtin.command:
+ cmd: "makepkg --syncdeps --noconfirm"
+ chdir: "/tmp/yay-bin"
+ args:
+ creates: "/tmp/yay-bin/yay-bin-*.pkg.tar.zst"
+
+ - name: "Install yay bin"
+ become: true
+ ansible.builtin.shell:
+ cmd: "pacman -U --noconfirm /tmp/yay-bin/yay-bin-*.pkg.tar.zst"
+ args:
+ creates: "/usr/bin/yay"