Note
This module is part of the theforeman.foreman collection (version 4.2.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 theforeman.foreman. You need further requirements to be able to use this module, see Requirements for details.
To use it in a playbook, specify: theforeman.foreman.content_view_version.
New in theforeman.foreman 1.0.0
Aliases: katello_content_view_version
The below requirements are needed on the host that executes this module.
Parameter | Comments |
|---|---|
content_view string / required | Name of the content view |
current_lifecycle_environment string | The lifecycle environment that is already associated with the content view version Helpful for promoting a content view version |
description string | Description of the Content View Version |
force_promote aliases: force boolean | Force content view promotion and bypass lifecycle environment restriction Choices:
|
force_yum_metadata_regeneration boolean | Force metadata regeneration when performing Publish and Promote tasks Choices:
|
lifecycle_environments list / elements=string | The lifecycle environments the Content View Version should be in. |
organization string / required | Organization that the entity is in |
password string / required | Password of the user accessing the Foreman server. If the value is not specified in the task, the value of environment variable |
server_url string / required | URL of the Foreman server. If the value is not specified in the task, the value of environment variable |
state string | State of the entity Choices:
|
username string / required | Username accessing the Foreman server. If the value is not specified in the task, the value of environment variable |
validate_certs boolean | 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:
|
version string | The content view version number (i.e. 1.0) |
Attribute | Support | Description |
|---|---|---|
check_mode | Support: full | Can run in check_mode and return changed status prediction without modifying the entity |
diff_mode | Support: full | Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode |
Note
version or current_lifecycle_environment.- name: "Ensure content view version 2.0 is in Test & Pre Prod"
theforeman.foreman.content_view_version:
username: "admin"
password: "changeme"
server_url: "https://foreman.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"
theforeman.foreman.content_view_version:
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
content_view: "CV 1"
organization: "Default Organization"
current_lifecycle_environment: Test
lifecycle_environments:
- Pre Prod
- name: "Publish a content view, not idempotent"
theforeman.foreman.content_view_version:
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
content_view: "CV 1"
organization: "Default Organization"
- name: "Publish a content view and promote that version to Library & Dev, not idempotent"
theforeman.foreman.content_view_version:
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
content_view: "CV 1"
organization: "Default Organization"
lifecycle_environments:
- Library
- Dev
- name: "Ensure content view version 1.0 doesn't exist"
theforeman.foreman.content_view_version:
username: "admin"
password: "changeme"
server_url: "https://foreman.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
theforeman.foreman.resource_info:
username: "admin"
password: "changeme"
server_url: "https://foreman.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 }}"
theforeman.foreman.resource_info:
username: "admin"
password: "changeme"
server_url: "https://foreman.example.com"
organization: "Default Organization"
resource: content_view_versions
params:
content_view_id: "{{ example_content.resources[0].id }}"
register: version_information
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
|---|---|
entity dictionary | Final state of the affected entities grouped by their type. Returned: success |
|
content_view_versions list / elements=dictionary |
List of content view versions. Returned: success |
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/theforeman/foreman/content_view_version_module.html