redhat.satellite.content_view_version module – Manage Content View Versions
Note
This module is part of the redhat.satellite collection (version 3.3.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install redhat.satellite
.
To use it in a playbook, specify: redhat.satellite.content_view_version
.
New in version 1.0.0: of redhat.satellite
Synopsis
Publish, Promote or Remove a Content View Version
Requirements
The below requirements are needed on the host that executes this module.
requests
Parameters
Parameter |
Comments |
---|---|
Name of the content view |
|
The lifecycle environment that is already associated with the content view version Helpful for promoting a content view version |
|
Description of the Content View Version |
|
Force content view promotion and bypass lifecycle environment restriction Choices:
|
|
Force metadata regeneration when performing Publish and Promote tasks Choices:
|
|
The lifecycle environments the Content View Version should be in. |
|
Organization that the entity is in |
|
Password of the user accessing the Foreman server. If the value is not specified in the task, the value of environment variable |
|
URL of the Foreman server. If the value is not specified in the task, the value of environment variable |
|
State of the entity Choices:
|
|
Username accessing the Foreman server. If the value is not specified in the task, the value of environment variable |
|
Whether or not to verify the TLS certificates of the Foreman server. If the value is not specified in the task, the value of environment variable Choices:
|
|
The content view version number (i.e. 1.0) |
Notes
Note
You cannot use this to remove a Content View Version from a Lifecycle environment, you should promote another version first.
For idempotency you must specify either
version
orcurrent_lifecycle_environment
.
Examples
- name: "Ensure content view version 2.0 is in Test & Pre Prod"
redhat.satellite.content_view_version:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
content_view: "CV 1"
organization: "Default Organization"
version: "2.0"
lifecycle_environments:
- Test
- Pre Prod
- name: "Ensure content view version in Test is also in Pre Prod"
redhat.satellite.content_view_version:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
content_view: "CV 1"
organization: "Default Organization"
current_lifecycle_environment: Test
lifecycle_environments:
- Pre Prod
- name: "Publish a content view, not idempotent"
redhat.satellite.content_view_version:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
content_view: "CV 1"
organization: "Default Organization"
- name: "Publish a content view and promote that version to Library & Dev, not idempotent"
redhat.satellite.content_view_version:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
content_view: "CV 1"
organization: "Default Organization"
lifecycle_environments:
- Library
- Dev
- name: "Ensure content view version 1.0 doesn't exist"
redhat.satellite.content_view_version:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
content_view: "Web Servers"
organization: "Default Organization"
version: "1.0"
state: absent
# Obtain information about a Content View and its versions
- name: find all CVs
redhat.satellite.resource_info:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
organization: "Default Organization"
resource: content_views
search: 'name="Example Content"'
register: example_content
# Obtain more details about all versions of a specific Content View
- name: "find content view versions of {{ cv_id }}"
redhat.satellite.resource_info:
username: "admin"
password: "changeme"
server_url: "https://satellite.example.com"
organization: "Default Organization"
resource: content_view_versions
params:
content_view_id: "{{ example_content.resources[0].id }}"
register: version_information
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Final state of the affected entities grouped by their type. Returned: success |
|
List of content view versions. Returned: success |