ovirt.ovirt_collection.ovirt_event (1.0.2) — module

Create or delete an event in oVirt/RHV

| "added in version" 1.0.0 of ovirt.ovirt_collection"

Authors: Chris Keller (@nasx)

preview | supported by community

Install collection

Install with ansible-galaxy collection install ovirt.ovirt_collection:==1.0.2


Add to requirements.yml

  collections:
    - name: ovirt.ovirt_collection
      version: 1.0.2

Description

This module can be used to create or delete an event in oVirt/RHV.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Examples don't contain the auth parameter for simplicity,
# look at the ovirt_auth module to see how to reuse authentication.

- name: Create an event
  ovirt_event:
    state: present
    description: "The file system /home on host xyz is almost full!"
    origin: "mymonitor"
    custom_id: 123456789
    severity: warning
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Create an event and link it to a specific object
  ovirt_event:
    state: present
    description: "The file system /home is almost full!"
    origin: "mymonitor"
    custom_id: 123456789
    severity: warning
    vm: "c79db183-46ef-44d1-95f9-1a368c516c19"
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove an event
  ovirt_event:
    state: absent
    id: 123456789
    wait: false

Inputs

    
id:
    description:
    - The event ID in the oVirt/RHV audit_log table. This ID is not the same as custom_id
      and is only used when state is absent.
    - Required when state is absent.
    type: str

vm:
    description:
    - The id of the VM associated with this event.
    type: str

auth:
    description:
    - 'Dictionary with values needed to create HTTP/HTTPS connection to oVirt:'
    required: true
    suboptions:
      ca_file:
        description:
        - A PEM file containing the trusted CA certificates.
        - The certificate presented by the server will be verified using these CA certificates.
        - If C(ca_file) parameter is not set, system wide CA certificate store is used.
        - Default value is set by C(OVIRT_CAFILE) environment variable.
        type: str
      headers:
        description:
        - Dictionary of HTTP headers to be added to each API call.
        type: dict
      hostname:
        description:
        - A string containing the hostname of the server, usually something like `I(server.example.com)`.
        - Default value is set by C(OVIRT_HOSTNAME) environment variable.
        - Either C(url) or C(hostname) is required.
        type: str
      insecure:
        description:
        - A boolean flag that indicates if the server TLS certificate and host name should
          be checked.
        type: bool
      kerberos:
        description:
        - A boolean flag indicating if Kerberos authentication should be used instead
          of the default basic authentication.
        type: bool
      password:
        description:
        - The password of the user.
        - Default value is set by C(OVIRT_PASSWORD) environment variable.
        required: true
        type: str
      token:
        description:
        - Token to be used instead of login with username/password.
        - Default value is set by C(OVIRT_TOKEN) environment variable.
        type: str
      url:
        description:
        - A string containing the API URL of the server, usually something like `I(https://server.example.com/ovirt-engine/api)`.
        - Default value is set by C(OVIRT_URL) environment variable.
        - Either C(url) or C(hostname) is required.
        type: str
      username:
        description:
        - The name of the user, something like I(admin@internal).
        - Default value is set by C(OVIRT_USERNAME) environment variable.
        required: true
        type: str
    type: dict

host:
    description:
    - The id of the host associated with this event.
    type: str

user:
    description:
    - The id of the user associated with this event.
    type: str

wait:
    default: true
    description:
    - C(yes) if the module should wait for the entity to get into desired state.
    type: bool

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Should the event be present/absent.
    - The C(wait) option must be set to false when state is absent.
    type: str

origin:
    description:
    - Originator of the event.
    - Required when state is present.
    type: str

cluster:
    description:
    - The id of the cluster associated with this event.
    type: str

timeout:
    default: 180
    description:
    - The amount of time in seconds the module should wait for the instance to get into
      desired state.
    type: int

severity:
    choices:
    - error
    - normal
    - warning
    default: normal
    description:
    - Severity of the event.
    - Required when state is present.
    type: str

template:
    description:
    - The id of the template associated with this event.
    type: str

custom_id:
    description:
    - Custom ID for the event. This ID must be unique for each event.
    - Required when state is present.
    type: int

data_center:
    description:
    - The id of the data center associated with this event.
    type: str

description:
    description:
    - Message for the event.
    - Required when state is present.
    type: str

fetch_nested:
    description:
    - If I(True) the module will fetch additional data from the API.
    - It will fetch IDs of the VMs disks, snapshots, etc. User can configure to fetch
      other attributes of the nested entities by specifying C(nested_attributes).
    type: bool

poll_interval:
    default: 3
    description:
    - Number of the seconds the module waits until another poll request on entity status
      is sent.
    type: int

storage_domain:
    description:
    - The id of the storage domain associated with this event.
    type: str

nested_attributes:
    description:
    - Specifies list of the attributes which should be fetched from the API.
    - This parameter apply only when C(fetch_nested) is I(true).
    type: list

Outputs

event:
  description: 'Dictionary of all the Event attributes. All event attributes can be
    found at the following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/event'
  returned: On success.
  type: dict
id:
  description: ID of the event that was created.
  returned: On success.
  type: str