community.general.pulp_repo (8.5.0) — module

Add or remove Pulp repos from a remote host

Authors: Joe Adams (@sysadmind)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Add or remove Pulp repos from a remote host.

Note, this is for Pulp 2 only.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a new repo with name 'my_repo'
  community.general.pulp_repo:
    name: my_repo
    relative_url: my/repo
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create a repo with a feed and a relative URL
  community.general.pulp_repo:
    name: my_centos_updates
    repo_type: rpm
    feed: http://mirror.centos.org/centos/6/updates/x86_64/
    relative_url: centos/6/updates
    url_username: admin
    url_password: admin
    force_basic_auth: true
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove a repo from the pulp server
  community.general.pulp_repo:
    name: my_old_repo
    repo_type: rpm
    state: absent

Inputs

    
url:
    description:
    - HTTP, HTTPS, or FTP URL in the form (http|https|ftp)://[user[:pass]]@host.domain[:port]/path
    type: str

feed:
    description:
    - Upstream feed URL to receive updates from.
    type: str

name:
    aliases:
    - repo
    description:
    - Name of the repo to add or remove. This correlates to repo-id in Pulp.
    required: true
    type: str

force:
    default: false
    description:
    - If V(yes) do not get a cached copy.
    type: bool

state:
    choices:
    - present
    - absent
    - sync
    - publish
    default: present
    description:
    - The repo state. A state of V(sync) will queue a sync of the repo. This is asynchronous
      but not delayed like a scheduled sync. A state of V(publish) will use the repository's
      distributor to publish the content.
    type: str

repoview:
    default: false
    description:
    - Whether to generate repoview files for a published repository. Setting this to V(true)
      automatically activates O(generate_sqlite).
    required: false
    type: bool

pulp_host:
    default: https://127.0.0.1
    description:
    - URL of the pulp server to connect to.
    type: str

repo_type:
    default: rpm
    description:
    - Repo plugin type to use (that is, V(rpm), V(docker)).
    type: str

use_proxy:
    default: true
    description:
    - If V(no), it will not use a proxy, even if one is defined in an environment variable
      on the target hosts.
    type: bool

client_key:
    description:
    - PEM formatted file that contains your private key to be used for SSL client authentication.
    - If O(client_cert) contains both the certificate and key, this option is not required.
    type: path

http_agent:
    default: ansible-httpget
    description:
    - Header to identify as, generally appears in web server logs.
    type: str

proxy_host:
    default: null
    description:
    - Proxy url setting for the pulp repository importer. This is in the format scheme://host.
    required: false
    type: str

proxy_port:
    default: null
    description:
    - Proxy port setting for the pulp repository importer.
    required: false
    type: str

serve_http:
    default: false
    description:
    - Make the repo available over HTTP.
    type: bool

use_gssapi:
    default: false
    description:
    - Use GSSAPI to perform the authentication, typically this is for Kerberos or Kerberos
      through Negotiate authentication.
    - Requires the Python library L(gssapi,https://github.com/pythongssapi/python-gssapi)
      to be installed.
    - Credentials for GSSAPI can be specified with O(url_username)/O(url_password) or
      with the GSSAPI env var C(KRB5CCNAME) that specified a custom Kerberos credential
      cache.
    - NTLM authentication is B(not) supported even if the GSSAPI mech for NTLM has been
      installed.
    type: bool
    version_added: '2.11'
    version_added_collection: ansible.builtin

client_cert:
    description:
    - PEM formatted certificate chain file to be used for SSL client authentication.
    - This file can also include the key as well, and if the key is included, O(client_key)
      is not required.
    type: path

serve_https:
    default: true
    description:
    - Make the repo available over HTTPS.
    type: bool

feed_ca_cert:
    aliases:
    - importer_ssl_ca_cert
    description:
    - CA certificate string used to validate the feed source SSL certificate. This can
      be the file content or the path to the file.
    type: str

relative_url:
    description:
    - Relative URL for the local repository. It's required when state=present.
    type: str

url_password:
    description:
    - The password for use in HTTP basic authentication to the pulp API. If the O(url_username)
      parameter is not specified, the O(url_password) parameter will not be used.
    type: str

url_username:
    description:
    - The username for use in HTTP basic authentication to the pulp API.
    type: str

proxy_password:
    default: null
    description:
    - Proxy password for the pulp repository importer.
    required: false
    type: str

proxy_username:
    default: null
    description:
    - Proxy username for the pulp repository importer.
    required: false
    type: str

validate_certs:
    default: true
    description:
    - If V(false), SSL certificates will not be validated. This should only be used on
      personally controlled sites using self-signed certificates.
    type: bool

feed_client_key:
    aliases:
    - importer_ssl_client_key
    description:
    - Private key to the certificate specified in O(feed_client_cert), assuming it is
      not included in the certificate file itself. This can be the file content or the
      path to the file.
    type: str

generate_sqlite:
    default: false
    description:
    - Boolean flag to indicate whether sqlite files should be generated during a repository
      publish.
    required: false
    type: bool

feed_client_cert:
    aliases:
    - importer_ssl_client_cert
    description:
    - Certificate used as the client certificate when synchronizing the repository. This
      is used to communicate authentication information to the feed source. The value
      to this option must be the full path to the certificate. The specified file may
      be the certificate itself or a single file containing both the certificate and private
      key. This can be the file content or the path to the file.
    type: str

force_basic_auth:
    default: false
    description:
    - httplib2, the library used by the M(ansible.builtin.uri) module only sends authentication
      information when a webservice responds to an initial request with a 401 status.
      Since some basic auth services do not properly send a 401, logins will fail. This
      option forces the sending of the Basic authentication header upon initial request.
    type: bool

publish_distributor:
    description:
    - Distributor to use when O(state=publish). The default is to publish all distributors.
    type: str

wait_for_completion:
    default: false
    description:
    - Wait for asynchronous tasks to complete before returning.
    type: bool

add_export_distributor:
    default: false
    description:
    - Whether or not to add the export distributor to new C(rpm) repositories.
    type: bool

Outputs

repo:
  description: Name of the repo that the action was performed on.
  returned: success
  sample: my_repo
  type: str