pulp.squeezer.artifact (0.0.15) — module

Manage artifacts of a pulp api server instance

Authors: Matthias Dellweg (@mdellweg)

Install collection

Install with ansible-galaxy collection install pulp.squeezer:==0.0.15


Add to requirements.yml

  collections:
    - name: pulp.squeezer
      version: 0.0.15

Description

This performs CRD operations on artifacts in a pulp api server instance.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Read list of artifacts from pulp server
  pulp.squeezer.artifact:
    pulp_url: https://pulp.example.org
    username: admin
    password: password
  register: artifact_status
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Report pulp artifacts
  debug:
    var: artifact_status
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Upload a file
  pulp.squeezer.artifact:
    pulp_url: https://pulp.example.org
    username: admin
    password: password
    file: local_artifact.txt
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete an artifact by specifying a file
  pulp.squeezer.artifact:
    pulp_url: https://pulp.example.org
    username: admin
    password: password
    file: local_artifact.txt
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete an artifact by specifying the digest
  pulp.squeezer.artifact:
    pulp_url: https://pulp.example.org
    username: admin
    password: password
    sha256: 0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
    state: absent

Inputs

    
file:
    description:
    - A local file that should be turned into an artifact.
    type: path

state:
    choices:
    - present
    - absent
    description:
    - State the entity should be in
    type: str

sha256:
    description:
    - sha256 digest of the artifact to query or delete.
    - When specified together with file, it will be used to verify any transaction.
    type: str

timeout:
    default: 10
    description:
    - Time in seconds to wait for tasks.
    type: int

password:
    description:
    - Password of api user.
    - If no value is specified, the value of the environment variable C(SQUEEZER_PASSWORD)
      will be used as a fallback.
    required: false
    type: str

pulp_url:
    description:
    - URL of the server to connect to (without 'pulp/api/v3').
    - If no value is specified, the value of the environment variable C(SQUEEZER_PULP_URL)
      will be used as a fallback.
    required: true
    type: str

user_key:
    description:
    - Client certificate key of api user.
    required: false
    type: str

username:
    description:
    - Username of api user.
    - If no value is specified, the value of the environment variable C(SQUEEZER_USERNAME)
      will be used as a fallback.
    required: false
    type: str

user_cert:
    description:
    - Client certificate of api user.
    required: false
    type: str

chunk_size:
    default: 33554432
    description:
    - Size of the chunks to upload a file.
    type: int

validate_certs:
    default: true
    description:
    - Whether SSL certificates should be verified.
    - If no value is specified, the value of the environment variable C(SQUEEZER_VALIDATE_CERTS)
      will be used as a fallback.
    type: bool

refresh_api_cache:
    default: false
    description:
    - Whether the cached API specification should be invalidated.
    - It is recommended to use this once with the M(pulp.squeezer.status) module at the
      beginning of the playbook.
    type: bool

Outputs

artifact:
  description: Artifact details
  returned: when file or sha256 is given
  type: dict
artifacts:
  description: List of artifacts
  returned: when no file or sha256 is given
  type: list