salt.states.pkgrepo

Management of package repos

Package repositories can be managed with the pkgrepo state:

base:
  pkgrepo.managed:
    - human_name: CentOS-$releasever - Base
    - mirrorlist: http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
    - comments:
        - #http://mirror.centos.org/centos/$releasever/os/$basearch/
    - gpgcheck: 1
    - gpgkey: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
salt.states.pkgrepo.absent(name)

This function deletes the specified repo on the system, if it exists. It is essentially a wrapper around pkg.del_repo.

name
The name of the package repo, as it would be referred to when running the regular package manager commands.
salt.states.pkgrepo.managed(name, **kwargs)

This function manages the configuration on a system that points to the repositories for the system's package manager.

name
The name of the package repo, as it would be referred to when running the regular package manager commands.

For yum-based systems, take note of the following configuration values:

humanname
On yum-based systems, this is stored as the "name" value in the .repo file in /etc/yum.repos.d/. On yum-based systems, this is required.
baseurl
On yum-based systems, baseurl refers to a direct URL to be used for this yum repo. One of baseurl or mirrorlist is required.
mirrorlist
a URL which contains a collection of baseurls to choose from. On yum-based systems. One of baseurl or mirrorlist is required.
comments
Sometimes you want to supply additional information, but not as enabled configuration. Anything supplied for this list will be saved in the repo configuration with a comment marker (#) in front.

Parent topic

Table Of Contents

Previous topic

salt.states.pkg

Next topic

salt.states.postgres_database