readme improve comments

pull/41/head
kewl fft 2020-05-24 09:54:40 -04:00
parent d180d480bc
commit 37815ae827
1 changed files with 28 additions and 29 deletions

View File

@ -67,37 +67,12 @@ dependencies:
## Usage ## Usage
### Notes ### Notes
* The scope of this module is installation and update from the AUR; for package removal or system upgrade from the official repositories, it is recommended to use the official *pacman* module. * The scope of this module is installation and update from the AUR; for package removal or for updates from the repositories, it is recommended to use the official *pacman* module.
* The *--needed* parameter of the helper is systematically used, it means if a package is up to date, it is not built and reinstalled. * The *--needed* parameter of the helper is systematically used, it means if a package is up-to-date, it is not built and reinstalled.
### Examples
Use it in a task, as in the following examples:
```
# Install trizen using makepkg, skip if trizen is already installed
- aur: name=trizen use=makepkg state=present
become: yes
become_user: aur_builder
# Install package_name using the first known helper found
- aur: name=package_name
...
# Install package_name_1 and package_name_2 using trizen
- aur:
use: trizen
name:
- package_name_1
- package_name_2
...
# Upgrade - using pacaur
- aur: upgrade=yes use=pacaur
...
```
### Create the "aur_builder" user ### Create the "aur_builder" user
While Ansible expects to SSH as root, AUR helpers do not allow executing operations as root, they all fail with "you cannot perform this operation as root". It is therefore recommended to create a user, let's call it *aur_builder*, that has no need for password with pacman in sudoers. 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 can be done in Ansible with the following actions: This user can be created in Ansible with the following actions:
``` ```
- user: - user:
name: aur_builder name: aur_builder
@ -108,3 +83,27 @@ This can be done in Ansible with the following actions:
create: yes create: yes
validate: 'visudo -cf %s' validate: 'visudo -cf %s'
``` ```
### Examples
Use it in a task, as in the following examples:
```
# Install trizen using makepkg, skip if it is already installed
- aur: name=trizen use=makepkg state=present
become: yes
become_user: aur_builder
# Install package_name using the first known helper found
- aur: name=package_name
become: yes
become_user: aur_builder
# Install package_name_1 and package_name_2 using yay
- aur:
use: yay
name:
- package_name_1
- package_name_2
# Upgrade the system using yay, only act on AUR packages, note that dependency resolving will still include repository packages
- aur: upgrade=yes use=yay aur_only=yes
```