12 Commits
v0.42 ... v0.43

Author SHA1 Message Date
kewl
60c02a6652 Merge pull request #56 from grcancelliere/bugfix/def-lang-upgrade
Fix upgrade changed logic and language definition when using pikaur
2021-04-16 08:21:57 +01:00
kewl fft
6f5df32b4b lower case before test 2021-04-16 08:20:52 +01:00
kewl fft
93230880db capital N with pikaur 2021-04-16 08:15:27 +01:00
grcancelliere
813cbadc18 Fix upgrade changed logic and language definition when using pikaur 2021-04-16 07:55:46 +02:00
kewl
dc101ae394 Merge pull request #55 from Terseus/bugfix/ansible-doc-2.10-fix
Fix `ansible-doc aur` error about dictionary element length
2021-04-03 11:31:48 +01:00
Terseus
706b236058 Fix ansible-doc aur error about dictionary element length
Fixes the following error when running `ansible-doc aur`:

```
ERROR! Unable to retrieve documentation from 'aur' due to: dictionary
update sequence element #0 has length 1; 2 is required
```

It was because the `helper` value in the `RETURN` section was missing
the `description` key.
2021-04-03 12:17:10 +02:00
kewl
e8655fcf1c Merge pull request #53 from brettinternet/patch-1
Improve aur_builder example
2021-01-30 08:01:42 -05:00
Brett
d05e0bc979 add field for aur_builder user example without home dir 2021-01-29 22:43:26 -07:00
kewl
bff54cb367 Merge pull request #52 from hummeltech/Paru
Added `paru` as a helper option
2021-01-26 14:31:25 -05:00
David Hummel
652b11fd76 Alignment adjustment of Options table in README.md 2021-01-26 12:28:14 -07:00
David Hummel
5d5cc1e20d Added paru as a helper option 2021-01-26 10:41:55 -07:00
kewl fft
95aa8f3047 exit with error if empty name list 2021-01-20 16:57:45 -05:00
2 changed files with 23 additions and 17 deletions

View File

@@ -3,6 +3,7 @@ Ansible module to use some Arch User Repository (AUR) helpers as well as makepkg
The following helpers are supported and automatically selected, if present, in the order listed below:
- [yay](https://github.com/Jguer/yay)
- [paru](https://github.com/Morganamilo/paru)
- [pacaur](https://github.com/E5ten/pacaur)
- [trizen](https://github.com/trizen/trizen)
- [pikaur](https://github.com/actionless/pikaur)
@@ -12,17 +13,17 @@ The following helpers are supported and automatically selected, if present, in t
- [makepkg](https://wiki.archlinux.org/index.php/makepkg)
## Options
|Parameter |Choices/**Default** |Comments|
|--- |--- |---|
|name | |Name or list of names of the package(s) to install or upgrade.|
|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.|
|use |**auto**, yay, pacaur, trizen, pikaur, 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.|
|aur_only |yes, **no** |Limit helper operation to the AUR.|
|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.|
|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.|
|Parameter |Choices/**Default** |Comments|
|--- |--- |---|
|name | |Name or list of names of the package(s) to install or upgrade.|
|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.|
|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.|
|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.|
|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.|
|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.|
### Note
* Either *name* or *upgrade* is required, both cannot be used together.
@@ -80,6 +81,7 @@ This user can be created in an Ansible task with the following actions:
```
- user:
name: aur_builder
create_home: no
group: wheel
- lineinfile:
path: /etc/sudoers.d/11-install-aur_builder

View File

@@ -43,7 +43,7 @@ options:
description:
- The tool to use, 'auto' uses the first known helper found and makepkg as a fallback.
default: auto
choices: [ auto, yay, pacaur, trizen, pikaur, aurman, makepkg ]
choices: [ auto, yay, paru, pacaur, trizen, pikaur, aurman, makepkg ]
extra_args:
description:
@@ -90,7 +90,7 @@ RETURN = '''
msg:
description: action that has been taken
helper:
the helper that was actually used
description: the helper that was actually used
'''
EXAMPLES = '''
@@ -100,10 +100,11 @@ EXAMPLES = '''
become_user: aur_builder
'''
def_lang = ['env', 'LC_ALL=C']
def_lang = ['env', 'LC_ALL=C', 'LANGUAGE=C']
use_cmd = {
'yay': ['yay', '-S', '--noconfirm', '--needed', '--cleanafter'],
'paru': ['paru', '-S', '--noconfirm', '--needed', '--cleanafter'],
'pacaur': ['pacaur', '-S', '--noconfirm', '--noedit', '--needed'],
'trizen': ['trizen', '-S', '--noconfirm', '--noedit', '--needed'],
'pikaur': ['pikaur', '-S', '--noconfirm', '--noedit', '--needed'],
@@ -116,7 +117,7 @@ use_cmd_local_pkgbuild = {
'makepkg': ['makepkg', '--syncdeps', '--install', '--noconfirm', '--needed']
}
has_aur_option = ['yay', 'pacaur', 'trizen', 'pikaur', 'aurman']
has_aur_option = ['yay', 'paru', 'pacaur', 'trizen', 'pikaur', 'aurman']
def package_installed(module, package):
@@ -243,7 +244,7 @@ def upgrade(module, use, extra_args, aur_only):
rc, out, err = module.run_command(command, check_rc=True)
module.exit_json(
changed=not (out == '' or 'nothing to do' in out or 'No AUR updates found' in out),
changed=not (out == '' or 'nothing to do' in out.lower() or 'No AUR updates found' in out),
msg='upgraded system',
helper=use,
)
@@ -274,7 +275,7 @@ def install_packages(module, packages, use, extra_args, state, skip_pgp_check, i
command.append(package)
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)
changed_iter = changed_iter or not (out == '' or '-- skipping' in out or 'nothing to do' in out.lower())
message = 'installed package(s)' if changed_iter else 'package(s) already installed'
@@ -333,6 +334,9 @@ def make_module():
use = params['use']
if params['name'] == []:
module.fail_json(msg="'name' cannot be empty.")
if use == 'auto':
if params['extra_args'] is not None:
module.fail_json(msg="'extra_args' cannot be used with 'auto', a tool must be specified.")