theforeman / theforeman.foreman / 0.8.1 / module / katello_sync Sync a Katello repository or product Authors: Eric D Helms (@ehelms), Matthias M Dellweg (@mdellweg) ATIX AG preview | supported by communitytheforeman.foreman.katello_sync (0.8.1) — module
Install with ansible-galaxy collection install theforeman.foreman:==0.8.1
collections: - name: theforeman.foreman version: 0.8.1
Sync a Katello repository or product
- 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
product: description: Product to which the I(repository) lives in required: true type: str password: description: Password of the user accessing the Foreman server required: true type: str username: description: Username accessing the Foreman server required: true type: str repository: description: 'Name of the repository to sync If omitted, all repositories in I(product) are synched. ' type: str server_url: description: URL of the Foreman server required: true type: str organization: description: - Organization that the entity is in required: true type: str validate_certs: aliases: - verify_ssl default: true description: Whether or not to verify the TLS certificates of the Foreman server type: bool