Note
This module is part of the community.general collection (version 10.7.3).
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.
Parameter | Comments |
|---|---|
backtrack integer added in community.general 5.8.0 | Set backtrack value ( |
changed_use boolean | Include installed packages where USE flags have changed, except when. Flags that the user has not enabled are added or removed. ( Choices:
|
deep boolean | Consider the entire dependency tree of packages ( Choices:
|
depclean boolean | Remove packages not needed by explicitly merged packages ( If no package is specified, clean up the world’s dependencies. Otherwise, Choices:
|
getbinpkg boolean | Prefer packages specified at Choices:
|
getbinpkgonly boolean added in community.general 1.3.0 | Merge only packages specified at Choices:
|
jobs integer | Specifies the number of packages to build simultaneously. Since version 2.6: Value of |
keepgoing boolean | Continue as much as possible after an error. Choices:
|
loadavg float | 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 |
newuse boolean | Include installed packages where USE flags have changed ( Choices:
|
nodeps boolean | Only merge packages but not their dependencies ( Choices:
|
noreplace boolean | Do not re-emerge installed packages ( Choices:
|
oneshot boolean | Do not add the packages to the world file ( Choices:
|
onlydeps boolean | Only merge packages’ dependencies but not the packages ( Choices:
|
package aliases: name list / elements=string | Package atom or set, for example |
quiet boolean | Run emerge in quiet mode ( Choices:
|
quietbuild boolean | Redirect all build output to logs alone, and do not display it on stdout ( Choices:
|
quietfail boolean | Suppresses display of the build log on stdout (–quiet-fail). Only the die message and the path of the build log are displayed on stdout. Choices:
|
select boolean added in community.general 8.6.0 | If set to Please note that this option is not used for idempotency, it is only used when actually installing a package. Choices:
|
state string | State of the package atom. Choices:
|
sync string | Sync package repositories first. If If Choices:
|
update boolean | Update packages to the best version available ( Choices:
|
usepkg boolean | Tries to use the binary package(s) in the locally available packages directory. Choices:
|
usepkgonly boolean | Merge only binaries (no compiling). Choices:
|
verbose boolean | Run emerge in verbose mode ( Choices:
|
withbdeps boolean added in community.general 5.8.0 | Specifies that build time dependencies should be installed. Choices:
|
Attribute | Support | Description |
|---|---|---|
check_mode | Support: full | Can run in |
diff_mode | Support: none | Will return details on what has changed (or possibly needs changing in |
- 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
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/general/portage_module.html