-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* pacman: support yay as root * make pylint happy * minor adjustments * rollback some test actions * removal of user and pkgs in handlers * add comment to note * add changelog frag * fix doc * Update tests/integration/targets/pacman/tasks/yay-become.yml Co-authored-by: Felix Fontein <felix@fontein.de> * Update tests/integration/targets/pacman/tasks/yay-become.yml Co-authored-by: Felix Fontein <felix@fontein.de> * simplify pkg install in int. tests --------- Co-authored-by: Felix Fontein <felix@fontein.de>
- Loading branch information
1 parent
7748002
commit f6ee217
Showing
5 changed files
with
116 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
bugfixes: | ||
- pacman - module recognizes the output of ``yay`` running as ``root`` (https://github.com/ansible-collections/community.general/pull/6713). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
# Copyright (c) Ansible Project | ||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
- name: Remove user yaybuilder | ||
ansible.builtin.user: | ||
name: yaybuilder | ||
state: absent | ||
|
||
- name: Remove yay | ||
ansible.builtin.package: | ||
name: yay | ||
state: absent | ||
|
||
- name: Remove packages for yay-become | ||
ansible.builtin.package: | ||
name: | ||
- base-devel | ||
- yay | ||
- git | ||
- nmap | ||
state: absent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
# Copyright (c) Ansible Project | ||
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
# This is more convoluted that one might expect, because: | ||
# - yay is not available or installation in ArchLinux (as it is in Manjaro - issue 6184 reports using it) | ||
# - to install yay in ArchLinux requires building the package | ||
# - makepkg cannot be run as root, but the user running it must have sudo to install the resulting package | ||
|
||
- name: create user | ||
ansible.builtin.user: | ||
name: yaybuilder | ||
state: present | ||
notify: Remove user yaybuilder | ||
|
||
- name: grant sudo powers to builder | ||
community.general.sudoers: | ||
name: yaybuilder | ||
user: yaybuilder | ||
commands: ALL | ||
nopassword: true | ||
|
||
- name: Install base packages | ||
ansible.builtin.package: | ||
name: | ||
- base-devel | ||
- git | ||
- go | ||
state: present | ||
notify: Remove packages for yay-become | ||
|
||
- name: Hack permssions for the remote_tmp_dir | ||
ansible.builtin.file: | ||
path: "{{ remote_tmp_dir }}" | ||
mode: '0777' | ||
|
||
- name: Create temp directory for builder | ||
ansible.builtin.file: | ||
path: "{{ remote_tmp_dir }}/builder" | ||
owner: yaybuilder | ||
state: directory | ||
mode: '0755' | ||
|
||
- name: clone yay git repo | ||
become: true | ||
become_user: yaybuilder | ||
ansible.builtin.git: | ||
repo: https://aur.archlinux.org/yay.git | ||
dest: "{{ remote_tmp_dir }}/builder/yay" | ||
depth: 1 | ||
|
||
- name: make package | ||
become: true | ||
become_user: yaybuilder | ||
ansible.builtin.command: | ||
chdir: "{{ remote_tmp_dir }}/builder/yay" | ||
cmd: makepkg -si --noconfirm | ||
notify: Remove yay | ||
|
||
- name: Install nmap | ||
community.general.pacman: | ||
name: nmap | ||
state: present | ||
executable: yay | ||
extra_args: --builddir /var/cache/yay |