support name type list

This commit is contained in:
alex
2017-12-23 21:05:07 +01:00
parent 0c083b7899
commit 091077c382
2 changed files with 32 additions and 28 deletions

View File

@@ -13,7 +13,7 @@
## Options
|parameter|required |default |choices |comments|
|--- |--- |--- |--- |---|
|name |no | | |Name of the package to install or upgrade.|
|name |no | | |Name or list of names of the package(s) to install or upgrade.|
|upgrade |no |no |yes, no |Whether or not to upgrade whole system.|
|helper |no |pacaur |pacaur, trizen, yaourt, yay |Helper to use.|
@@ -21,28 +21,32 @@
## Usage
1. Add as a submodule in your playbook:
```
mkdir -p library/external_modules
git submodule add git://github.com/kewlfft/ansible-aur.git library/external_modules/ansible-aur
```
```
mkdir -p library/external_modules
git submodule add git://github.com/kewlfft/ansible-aur.git library/external_modules/ansible-aur
```
2. Link the binary to the base of `library/`:
```
ln -s external_modules/ansible-aur/aur library/aur
```
```
ln -s external_modules/ansible-aur/aur library/aur
```
3. Use it in a task, as in the following examples:
```
# Install (using pacaur)
- aur: name=package_name
become: yes
become_user: user_that_has_nopasswd_in_sudoers_for_pacman_use
```
# Install (using pacaur)
- aur: name=package_name
become: yes
become_user: user_that_has_nopasswd_in_sudoers_for_pacman_use
# Install (using trizen)
- aur: name=package_name helper=trizen
[...]
# Install (using trizen)
- aur:
helper: trizen
name:
- package_name_1
- package_name_2
[...]
# Upgrade (using pacaur)
- aur: upgrade=yes
[...]
```
# Upgrade (using pacaur)
- aur: upgrade=yes
[...]
```