Debian Codegraph @

ansible_collections/community/general/tests/integration/targets/pacman/tasks/yay-become.yml

raw
1 ---
2 # Copyright (c) Ansible Project
3 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
4 # SPDX-License-Identifier: GPL-3.0-or-later
5
6 # This is more convoluted that one might expect, because:
7 # - yay is not available or installation in ArchLinux (as it is in Manjaro - issue 6184 reports using it)
8 # - to install yay in ArchLinux requires building the package
9 # - makepkg cannot be run as root, but the user running it must have sudo to install the resulting package
10
11 - name: create user
12 ansible.builtin.user:
13 name: yaybuilder
14 state: present
15 notify: Remove user yaybuilder
16
17 - name: grant sudo powers to builder
18 community.general.sudoers:
19 name: yaybuilder
20 user: yaybuilder
21 commands: ALL
22 nopassword: true
23
24 - name: Install base packages
25 ansible.builtin.package:
26 name:
27 - base-devel
28 - git
29 - go
30 state: present
31 notify: Remove packages for yay-become
32
33 - name: Hack permissions for the remote_tmp_dir
34 ansible.builtin.file:
35 path: "{{ remote_tmp_dir }}"
36 mode: '0777'
37
38 - name: Create temp directory for builder
39 ansible.builtin.file:
40 path: "{{ remote_tmp_dir }}/builder"
41 owner: yaybuilder
42 state: directory
43 mode: '0755'
44
45 - name: clone yay git repo
46 become: true
47 become_user: yaybuilder
48 ansible.builtin.git:
49 depth: 1
50 dest: "{{ remote_tmp_dir }}/builder/yay"
51 repo: https://github.com/archlinux/aur.git
52 single_branch: true
53 version: yay
54
55 - name: make package
56 become: true
57 become_user: yaybuilder
58 ansible.builtin.command:
59 chdir: "{{ remote_tmp_dir }}/builder/yay"
60 cmd: makepkg -si --noconfirm
61 notify: Remove yay
62
63 - name: Install nmap
64 community.general.pacman:
65 name: nmap
66 state: present
67 executable: yay
68 extra_args: --builddir /var/cache/yay