portage - Package manager for Gentoo

New in version 1.6.

Synopsis

Requirements

The below requirements are needed on the host that executes this module.

  • gentoolkit

Parameters

Parameter Choices/Defaults Comments
changed_use
bool

(added in 1.8)
    Choices:
  • no ←
  • yes
Include installed packages where USE flags have changed, except when
flags that the user has not enabled are added or removed
(--changed-use)
deep
bool
    Choices:
  • no ←
  • yes
Consider the entire dependency tree of packages (--deep)
depclean
bool
    Choices:
  • no ←
  • yes
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
getbinpkg
bool
    Choices:
  • no ←
  • yes
Prefer packages specified at PORTAGE_BINHOST in make.conf
jobs
(added in 2.3)
Specifies the number of packages to build simultaneously.
Since version 2.6: Value of 0 or False resets any previously added
--jobs setting values
keepgoing
bool

(added in 2.3)
    Choices:
  • no ←
  • yes
Continue as much as possible after an error.
loadavg
(added in 2.3)
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
newuse
bool
    Choices:
  • no ←
  • yes
Include installed packages where USE flags have changed (--newuse)
nodeps
bool
    Choices:
  • no ←
  • yes
Only merge packages but not their dependencies (--nodeps)
noreplace
bool
    Choices:
  • no ←
  • yes
Do not re-emerge installed packages (--noreplace)
oneshot
bool
    Choices:
  • no ←
  • yes
Do not add the packages to the world file (--oneshot)
onlydeps
bool
    Choices:
  • no ←
  • yes
Only merge packages' dependencies but not the packages (--onlydeps)
package
Package atom or set, e.g. sys-apps/foo or >foo-2.13 or @world
quiet
bool
    Choices:
  • no ←
  • yes
Run emerge in quiet mode (--quiet)
quietbuild
bool

(added in 2.6)
    Choices:
  • no ←
  • yes
Redirect all build output to logs alone, and do not display it
on stdout (--quiet-build)
quietfail
bool

(added in 2.6)
    Choices:
  • no ←
  • yes
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.
state
    Choices:
  • present ←
  • installed
  • emerged
  • absent
  • removed
  • unmerged
  • latest
State of the package atom
sync
    Choices:
  • web
  • yes
  • no
Sync package repositories first
If yes, perform "emerge --sync"
If web, perform "emerge-webrsync"
update
bool
    Choices:
  • no ←
  • yes
Update packages to the best version available (--update)
usepkgonly
bool
    Choices:
  • no ←
  • yes
Merge only binaries (no compiling). This sets getbinpkg=yes.
verbose
bool
    Choices:
  • no ←
  • yes
Run emerge in verbose mode (--verbose)

Examples

# Make sure package foo is installed
- portage:
    package: foo
    state: present

# Make sure package foo is not installed
- portage:
    package: foo
    state: absent

# Update package foo to the "latest" version ( os specific alternative to latest )
- portage:
    package: foo
    update: yes

# Install package foo using PORTAGE_BINHOST setup
- portage:
    package: foo
    getbinpkg: yes

# Re-install world from binary packages only and do not allow any compiling
- portage:
    package: '@world'
    usepkgonly: yes

# Sync repositories and update world
- portage:
    package: '@world'
    update: yes
    deep: yes
    sync: yes

# Remove unneeded packages
- portage:
    depclean: yes

# Remove package foo if it is not explicitly needed
- portage:
    package: foo
    state: absent
    depclean: yes

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Maintenance

This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.

For a list of other modules that are also maintained by the Ansible Community, see here.

Author

  • William L Thomson Jr (@wltjr)
  • Yap Sok Ann (@sayap)
  • Andrew Udvare

Hint

If you notice any issues in this documentation you can edit this document to improve it.