theforeman.foreman.scap_content (4.0.0) — module

Manage SCAP content

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

Authors: Jameer Pathan (@jameerpathan111)

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

Create, update, and delete SCAP content


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create SCAP content
  theforeman.foreman.scap_content:
    title: "Red Hat firefox default content"
    scap_file: "/home/user/Downloads/ssg-firefox-ds.xml"
    original_filename: "ssg-firefox-ds.xml"
    organizations:
      - "Default Organization"
    locations:
      - "Default Location"
    server_url: "https://foreman.example.com"
    username: "admin"
    password: "changeme"
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Update SCAP content
  theforeman.foreman.scap_content:
    title: "Red Hat firefox default content"
    updated_title: "Updated scap content title"
    scap_file: "/home/user/Downloads/updated-ssg-firefox-ds.xml"
    original_filename: "updated-ssg-firefox-ds.xml"
    organizations:
      - "Org One"
      - "Org Two"
    locations:
      - "Loc One"
      - "Loc Two"
    server_url: "https://foreman.example.com"
    username: "admin"
    password: "changeme"
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete SCAP content
  theforeman.foreman.scap_content:
    title: "Red Hat firefox default content"
    server_url: "https://foreman.example.com"
    username: "admin"
    password: "changeme"
    state: absent

Inputs

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

title:
    description:
    - Title of SCAP content.
    required: true
    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

locations:
    description: List of locations the entity should be assigned to
    elements: str
    type: list

scap_file:
    description:
    - File containing XML DataStream content.
    - Required when creating a new DataStream.
    required: false
    type: path

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

organizations:
    description: List of organizations the entity should be assigned to
    elements: str
    type: list

updated_title:
    description:
    - New SCAP content title.
    - When this parameter is set, the module will not be idempotent.
    type: str

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

original_filename:
    description:
    - Original file name of the XML file.
    - If unset, the filename of I(scap_file) will be used.
    required: false
    type: str

Outputs

entity:
  contains:
    scap_contents:
      description: List of scap contents.
      elements: dict
      type: list
  description: Final state of the affected entities grouped by their type.
  returned: success
  type: dict