Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chornberger-c2c/562f4bccaf66036bfa70e08150147774 to your computer and use it in GitHub Desktop.
Save chornberger-c2c/562f4bccaf66036bfa70e08150147774 to your computer and use it in GitHub Desktop.
Check if Content View is up to date on Capsule
---
- name: Check if Content View is up to date on Capsule
hosts: localhost
tasks:
- name: Retrieve values from Satellite
ansible.builtin.uri:
url: "https://{{ satellite_fqdn }}/katello/api/capsules/{{ capsule_id }}/content/sync"
method: GET
url_username: "{{ satellite_user }}"
url_password: "{{ satellite_password }}"
validate_certs: false
body_format: json
force_basic_auth: true
register: result
- name: Print all values
ansible.builtin.debug:
var: result
- name: "Print Content Views that are not synchronized with Capsule {{ capsule_id }}"
ansible.builtin.debug:
msg: "{{ result | community.general.json_query('json.lifecycle_environments[*].content_views[?up_to_date == `false`].name') | join }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment