Add support for the aura helper

pull/74/head
William Turner 2022-06-09 02:10:25 -04:00
parent 9b25b11cea
commit 865e69b43d
2 changed files with 18 additions and 13 deletions

View File

@ -56,6 +56,7 @@ The following helpers are supported and automatically selected, if present, in t
- [pacaur](https://github.com/E5ten/pacaur) - [pacaur](https://github.com/E5ten/pacaur)
- [trizen](https://github.com/trizen/trizen) - [trizen](https://github.com/trizen/trizen)
- [pikaur](https://github.com/actionless/pikaur) - [pikaur](https://github.com/actionless/pikaur)
- [aura](https://github.com/fosskers/aura)
- [aurman](https://github.com/polygamma/aurman) (discontinued) - [aurman](https://github.com/polygamma/aurman) (discontinued)
*makepkg* will be used if no helper was found or if it is explicitly specified: *makepkg* will be used if no helper was found or if it is explicitly specified:
@ -70,12 +71,12 @@ The following helpers are supported and automatically selected, if present, in t
| state | **present**, latest | Desired state of the package, 'present' skips operations if the package is already installed. | | state | **present**, latest | Desired state of the package, 'present' skips operations if the package is already installed. |
| upgrade | yes, **no** | Whether or not to upgrade whole system. | | upgrade | yes, **no** | Whether or not to upgrade whole system. |
| update_cache | yes, **no** | Whether or not to refresh the packages cache | | update_cache | yes, **no** | Whether or not to refresh the packages cache |
| use | **auto**, yay, paru, pacaur, trizen, pikaur, aurman, makepkg | The tool to use, 'auto' uses the first known helper found and makepkg as a fallback. | | use | **auto**, yay, paru, pacaur, trizen, pikaur, aura, aurman, makepkg | The tool to use, 'auto' uses the first known helper found and makepkg as a fallback. |
| extra_args | **null** | A list of additional arguments to pass directly to the tool. Cannot be used in 'auto' mode. | | extra_args | **null** | A list of additional arguments to pass directly to the tool. Cannot be used in 'auto' mode. |
| aur_only | yes, **no** | Limit helper operation to the AUR. | | aur_only | yes, **no** | Limit helper operation to the AUR. Ignored with the aura helper, AUR is always used. |
| local_pkgbuild | Local directory with PKGBUILD, **null** | Only valid with makepkg or pikaur. Don't download the package from AUR. Build the package using a local PKGBUILD and the other build files. | | local_pkgbuild | Local directory with PKGBUILD, **null** | Only valid with makepkg or pikaur. Don't download the package from AUR. Build the package using a local PKGBUILD and the other build files. |
| skip_pgp_check | yes, **no** | Only valid with makepkg. Skip PGP signatures verification of source file, useful when installing packages without GnuPG properly configured. | | skip_pgp_check | yes, **no** | Only valid with makepkg or aura. Skip PGP signatures verification of source file, useful when installing packages without GnuPG properly configured. |
| ignore_arch | yes, **no** | Only valid with makepkg. Ignore a missing or incomplete arch field, useful when the PKGBUILD does not have the arch=('yourarch') field. | | ignore_arch | yes, **no** | Only valid with makepkg or aura. Ignore a missing or incomplete arch field, useful when the PKGBUILD does not have the arch=('yourarch') field. |
#### Note #### Note
@ -91,6 +92,8 @@ The following helpers are supported and automatically selected, if present, in t
#### Create the "aur_builder" user #### Create the "aur_builder" user
This is not needed if the aura helper is used since it must run as root.
While Ansible expects to SSH as root, makepkg or AUR helpers do not allow executing operations as root, they fail with "you cannot perform this operation as root". It is therefore recommended to create a user, which is non-root but has no need for password with pacman in sudoers, let's call it *aur_builder*. While Ansible expects to SSH as root, makepkg or AUR helpers do not allow executing operations as root, they fail with "you cannot perform this operation as root". It is therefore recommended to create a user, which is non-root but has no need for password with pacman in sudoers, let's call it *aur_builder*.
This user can be created in an Ansible task with the following actions: This user can be created in an Ansible task with the following actions:

View File

@ -49,7 +49,7 @@ options:
description: description:
- The tool to use, 'auto' uses the first known helper found and makepkg as a fallback. - The tool to use, 'auto' uses the first known helper found and makepkg as a fallback.
default: auto default: auto
choices: [ auto, yay, paru, pacaur, trizen, pikaur, aurman, makepkg ] choices: [ auto, yay, paru, pacaur, trizen, pikaur, aura, aurman, makepkg ]
extra_args: extra_args:
description: description:
@ -59,24 +59,25 @@ options:
skip_pgp_check: skip_pgp_check:
description: description:
- Only valid with makepkg. - Only valid with makepkg and aura.
Skip PGP signatures verification of source file. Skip PGP signatures verification of source file.
This is useful when installing packages without GnuPG (properly) configured. This is useful when installing packages without GnuPG (properly) configured.
Cannot be used unless use is set to 'makepkg'. Cannot be used unless use is set to 'makepkg' or 'aura'.
type: bool type: bool
default: no default: no
ignore_arch: ignore_arch:
description: description:
- Only valid with makepkg. - Only valid with makepkg and aura.
Ignore a missing or incomplete arch field, useful when the PKGBUILD does not have the arch=('yourarch') field. Ignore a missing or incomplete arch field, useful when the PKGBUILD does not have the arch=('yourarch') field.
Cannot be used unless use is set to 'makepkg'. Cannot be used unless use is set to 'makepkg' or 'aura'.
type: bool type: bool
default: no default: no
aur_only: aur_only:
description: description:
- Limit helper operation to the AUR. - Limit helper operation to the AUR.
Ignored with the aura helper, AUR is always used.
type: bool type: bool
default: no default: no
@ -114,6 +115,7 @@ use_cmd = {
'pacaur': ['pacaur', '-S', '--noconfirm', '--noedit', '--needed'], 'pacaur': ['pacaur', '-S', '--noconfirm', '--noedit', '--needed'],
'trizen': ['trizen', '-S', '--noconfirm', '--noedit', '--needed'], 'trizen': ['trizen', '-S', '--noconfirm', '--noedit', '--needed'],
'pikaur': ['pikaur', '-S', '--noconfirm', '--noedit', '--needed'], 'pikaur': ['pikaur', '-S', '--noconfirm', '--noedit', '--needed'],
'aura': ['aura', '-A', '--noconfirm', '--needed', '--clean', '--delmakedeps'],
'aurman': ['aurman', '-S', '--noconfirm', '--noedit', '--needed', '--skip_news', '--pgp_fetch', '--skip_new_locations'], 'aurman': ['aurman', '-S', '--noconfirm', '--noedit', '--needed', '--skip_news', '--pgp_fetch', '--skip_new_locations'],
'makepkg': ['makepkg', '--syncdeps', '--install', '--noconfirm', '--needed'] 'makepkg': ['makepkg', '--syncdeps', '--install', '--noconfirm', '--needed']
} }
@ -283,7 +285,7 @@ def install_packages(module, packages, use, extra_args, state, skip_pgp_check, i
command.append(package) command.append(package)
rc, out, err = module.run_command(command, check_rc=True) rc, out, err = module.run_command(command, check_rc=True)
changed_iter = changed_iter or not (out == '' or '-- skipping' in out or 'nothing to do' in out.lower()) changed_iter = changed_iter or not (out == '' or '-- skipping' in out or 'nothing to do' in out.lower() or 'no valid package' in out.lower())
message = 'installed package(s)' if changed_iter else 'package(s) already installed' message = 'installed package(s)' if changed_iter else 'package(s) already installed'
@ -359,10 +361,10 @@ def make_module():
use = k use = k
break break
if use != 'makepkg' and (params['skip_pgp_check'] or params['ignore_arch']): if use not in ('makepkg', 'aura') and (params['skip_pgp_check'] or params['ignore_arch']):
module.fail_json(msg="This option is only available with 'makepkg'.") module.fail_json(msg="This option is only available with 'makepkg' and 'aura'.")
if not (use in use_cmd_local_pkgbuild) and params['local_pkgbuild']: if use not in use_cmd_local_pkgbuild and params['local_pkgbuild']:
module.fail_json(msg="This option is not available with '%s'" % use) module.fail_json(msg="This option is not available with '%s'" % use)
if params['local_pkgbuild'] and not os.path.isdir(params['local_pkgbuild']): if params['local_pkgbuild'] and not os.path.isdir(params['local_pkgbuild']):