pkubica.ovirt.ovirt_user (1.4.3) — module

Module to manage users in oVirt/RHV

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

Authors: Ondra Machacek (@machacekondra)

Install collection

Install with ansible-galaxy collection install pkubica.ovirt:==1.4.3


Add to requirements.yml

  collections:
    - name: pkubica.ovirt
      version: 1.4.3

Description

Module to manage users in oVirt/RHV.


Requirements

Usage examples

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

# Add user user1 from authorization provider example.com-authz
- pkubica.ovirt.ovirt_user:
    name: user1
    domain: example.com-authz
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Add user user1 from authorization provider example.com-authz
# In case of Active Directory specify UPN:
- pkubica.ovirt.ovirt_user:
    name: user1@ad2.example.com
    domain: example.com-authz
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Remove user user1 with authorization provider example.com-authz
- pkubica.ovirt.ovirt_user:
    state: absent
    name: user1
    authz_name: example.com-authz
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Remove ssh_public_key
- pkubica.ovirt.ovirt_user:
    name: user1
    authz_name: example.com-authz
    ssh_public_key: ""

Inputs

    
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
      compress:
        default: true
        description: Flag indicating if compression is used for connection.
        type: bool
      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
      timeout:
        description: Number of seconds to wait for response.
        type: int
      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

name:
    description:
    - Name of the user to manage. In most LDAPs it's I(uid) of the user, but in Active
      Directory you must specify I(UPN) of the user.
    required: true
    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 user be present/absent.
    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

namespace:
    description:
    - Namespace where the user resides. When using the authorization provider that stores
      users in the LDAP server, this attribute equals the naming context of the LDAP server.
    type: str

authz_name:
    aliases:
    - domain
    description:
    - Authorization provider of the user. In previous versions of oVirt/RHV known as domain.
    required: true
    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

ssh_public_key:
    description:
    - The user public key.
    type: str
    version_added: 1.4.0
    version_added_collection: pkubica.ovirt

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).
    elements: str
    type: list

Outputs

id:
  description: ID of the user which is managed
  returned: On success if user is found.
  sample: 7de90f31-222c-436c-a1ca-7e655bd5b60c
  type: str
user:
  description: 'Dictionary of all the user attributes. User attributes can be found
    on your oVirt/RHV instance at following url: http://ovirt.github.io/ovirt-engine-api-model/master/#types/user.'
  returned: On success if user is found.
  type: dict