katello_sync – Sync a Katello repository or product

Synopsis

  • Sync a Katello repository or product

Requirements

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

  • apypie

Parameters

Parameter Choices/Defaults Comments
organization
string / required
Organization that the entity is in
password
string / required
Password of the user accessing the Foreman server
product
string / required
Product to which the repository lives in
repository
string
Name of the repository to sync If omitted, all repositories in product are synched.
server_url
string / required
URL of the Foreman server
username
string / required
Username accessing the Foreman server
validate_certs
boolean
    Choices:
  • no
  • yes ←
Whether or not to verify the TLS certificates of the Foreman server

aliases: verify_ssl

Examples

- name: "Sync repository"
  katello_sync:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    repository: "My repository"
    product: "My Product"
    organization: "Default Organization"

# Sync all repositories
- name: Get all repositories
  foreman_search_facts:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    resource: repositories
  register: repositories

- name: Kick off repository Sync tasks
  katello_sync:
    username: "admin"
    password: "changeme"
    server_url: "https://foreman.example.com"
    product: "{{ item.product.name }}"
    repository:  "{{ item.name }}"
    organization: "Default Organization"
  loop: "{{ repositories.resources }}"
  when: item.url  # Not all repositories have a URL
  async: 999999
  poll: 0
  register: repo_sync_sleeper

- name: Wait until all Syncs have finished
  async_status:
    jid: "{{ repo_sync_sleeper_item.ansible_job_id }}"
  loop: "{{ repo_sync_sleeper.results }}"
  loop_control:
    loop_var: repo_sync_sleeper_item
  when: repo_sync_sleeper_item.ansible_job_id is defined  # Skip items that were skipped in the previous task
  register: async_job_result
  until: async_job_result.finished
  retries: 999
  delay: 10

Status

Authors

  • Eric D Helms (@ehelms)

  • Matthias M Dellweg (@mdellweg) ATIX AG

Hint

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