community.general.portage module – Package manager for Gentoo
Note
This module is part of the community.general collection (version 8.6.7).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.portage
.
Synopsis
Manages Gentoo packages
Aliases: packaging.os.portage
Parameters
Parameter |
Comments |
---|---|
Set backtrack value ( |
|
Include installed packages where USE flags have changed, except when flags that the user has not enabled are added or removed (–changed-use) Choices:
|
|
Consider the entire dependency tree of packages (–deep) Choices:
|
|
Remove packages not needed by explicitly merged packages (–depclean) If no package is specified, clean up the world’s dependencies Otherwise, –depclean serves as a dependency aware version of –unmerge Choices:
|
|
Prefer packages specified at Choices:
|
|
Merge only packages specified at Choices:
|
|
Specifies the number of packages to build simultaneously. Since version 2.6: Value of 0 or False resets any previously added –jobs setting values |
|
Continue as much as possible after an error. Choices:
|
|
Specifies that no new builds should be started if there are other builds running and the load average is at least LOAD Since version 2.6: Value of 0 or False resets any previously added –load-average setting values |
|
Include installed packages where USE flags have changed (–newuse) Choices:
|
|
Only merge packages but not their dependencies (–nodeps) Choices:
|
|
Do not re-emerge installed packages (–noreplace) Choices:
|
|
Do not add the packages to the world file (–oneshot) Choices:
|
|
Only merge packages’ dependencies but not the packages (–onlydeps) Choices:
|
|
Package atom or set, for example |
|
Run emerge in quiet mode (–quiet) Choices:
|
|
Redirect all build output to logs alone, and do not display it on stdout (–quiet-build) Choices:
|
|
Suppresses display of the build log on stdout (–quiet-fail) Only the die message and the path of the build log will be displayed on stdout. Choices:
|
|
If set to Please note that this option is not used for idempotency, it is only used when actually installing a package. Choices:
|
|
State of the package atom Choices:
|
|
Sync package repositories first If If Choices:
|
|
Update packages to the best version available (–update) Choices:
|
|
Tries to use the binary package(s) in the locally available packages directory. Choices:
|
|
Merge only binaries (no compiling). Choices:
|
|
Run emerge in verbose mode (–verbose) Choices:
|
|
Specifies that build time dependencies should be installed. Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Examples
- name: Make sure package foo is installed
community.general.portage:
package: foo
state: present
- name: Make sure package foo is not installed
community.general.portage:
package: foo
state: absent
- name: Update package foo to the latest version (os specific alternative to latest)
community.general.portage:
package: foo
update: true
- name: Install package foo using PORTAGE_BINHOST setup
community.general.portage:
package: foo
getbinpkg: true
- name: Re-install world from binary packages only and do not allow any compiling
community.general.portage:
package: '@world'
usepkgonly: true
- name: Sync repositories and update world
community.general.portage:
package: '@world'
update: true
deep: true
sync: true
- name: Remove unneeded packages
community.general.portage:
depclean: true
- name: Remove package foo if it is not explicitly needed
community.general.portage:
package: foo
state: absent
depclean: true