theforeman.foreman.content_view_version (4.0.0) — module

Manage Content View Versions

| "added in version" 1.0.0 of theforeman.foreman"

Authors: Sean O'Keeffe (@sean797)

Install collection

Install with ansible-galaxy collection install theforeman.foreman:==4.0.0


Add to requirements.yml

  collections:
    - name: theforeman.foreman
      version: 4.0.0

Description

Publish, Promote or Remove a Content View Version


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# 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

Inputs

    
state:
    choices:
    - present
    - absent
    default: present
    description:
    - State of the entity
    type: str

version:
    description:
    - The content view version number (i.e. 1.0)
    type: str

password:
    description:
    - Password of the user accessing the Foreman server.
    - If the value is not specified in the task, the value of environment variable C(FOREMAN_PASSWORD)
      will be used instead.
    required: true
    type: str

username:
    description:
    - Username accessing the Foreman server.
    - If the value is not specified in the task, the value of environment variable C(FOREMAN_USERNAME)
      will be used instead.
    required: true
    type: str

server_url:
    description:
    - URL of the Foreman server.
    - If the value is not specified in the task, the value of environment variable C(FOREMAN_SERVER_URL)
      will be used instead.
    required: true
    type: str

description:
    description:
    - Description of the Content View Version
    type: str

content_view:
    description:
    - Name of the content view
    required: true
    type: str

organization:
    description:
    - Organization that the entity is in
    required: true
    type: str

force_promote:
    aliases:
    - force
    default: false
    description:
    - Force content view promotion and bypass lifecycle environment restriction
    type: bool

validate_certs:
    default: true
    description:
    - 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 C(FOREMAN_VALIDATE_CERTS)
      will be used instead.
    type: bool

lifecycle_environments:
    description:
    - The lifecycle environments the Content View Version should be in.
    elements: str
    type: list

current_lifecycle_environment:
    description:
    - The lifecycle environment that is already associated with the content view version
    - Helpful for promoting a content view version
    type: str

force_yum_metadata_regeneration:
    default: false
    description:
    - Force metadata regeneration when performing Publish and Promote tasks
    type: bool

Outputs

entity:
  contains:
    content_view_versions:
      description: List of content view versions.
      elements: dict
      type: list
  description: Final state of the affected entities grouped by their type.
  returned: success
  type: dict