New in version 2.2.
auth
parameter, to perform authentication.The below requirements are needed on the host that executes this module.
Parameter | Choices/Defaults | Comments |
---|---|---|
ca_file |
A PEM file containing the trusted CA certificates. The certificate presented by the server will be verified using these CA certificates. If
ca_file parameter is not set, system wide CA certificate store is used. Default value is set by OVIRT_CAFILE environment variable. |
|
compress |
A boolean flag indicating if the SDK should ask the server to send compressed responses. The default is True. Note that this is a hint for the server, and that it may return uncompressed data even when this parameter is set to True.
|
|
headers
(added in 2.4) |
A dictionary of HTTP headers to be added to each API call.
|
|
insecure |
A boolean flag that indicates if the server TLS certificate and host name should be checked.
|
|
kerberos |
A boolean flag indicating if Kerberos authentication should be used instead of the default basic authentication.
|
|
password |
The password of the user. Default value is set by OVIRT_PASSWORD environment variable.
|
|
state |
|
Specifies if a token should be created or revoked.
|
timeout |
The maximum total time to wait for the response, in seconds. A value of zero (the default) means wait forever. If the timeout expires before the response is received an exception will be raised.
|
|
token
(added in 2.5) |
SSO token to be used instead of login with username/password. Default value is set by OVIRT_TOKEN environment variable.
|
|
url |
A string containing the base URL of the server. For example: https://server.example.com/ovirt-engine/api. Default value is set by OVIRT_URL environment variable.
|
|
username |
The name of the user. For example: admin@internal Default value is set by OVIRT_USERNAME environment variable.
|
Note
- block:
# Create a vault with `ovirt_password` variable which store your
# oVirt/RHV user's password, and include that yaml file with variable:
- include_vars: ovirt_password.yml
- name: Obtain SSO token with using username/password credentials
ovirt_auth:
url: https://ovirt.example.com/ovirt-engine/api
username: admin@internal
ca_file: ca.pem
password: "{{ ovirt_password }}"
# Previous task generated I(ovirt_auth) fact, which you can later use
# in different modules as follows:
- ovirt_vms:
auth: "{{ ovirt_auth }}"
state: absent
name: myvm
always:
- name: Always revoke the SSO token
ovirt_auth:
state: absent
ovirt_auth: "{{ ovirt_auth }}"
# When user will set following environment variables:
# OVIRT_URL = https://fqdn/ovirt-engine/api
# OVIRT_USERNAME = admin@internal
# OVIRT_PASSWORD = the_password
# He can login the oVirt using environment variable instead of variables
# in yaml file.
# This is mainly usefull when using Ansible Tower or AWX, as it will work
# for Red Hat Virtualization creadentials type.
- name: Obtain SSO token
ovirt_auth:
state: present
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description | |
---|---|---|---|
ovirt_auth
complex
|
success |
Authentication facts, needed to perform authentication to oVirt/RHV.
|
|
timeout
int
|
success |
Number of seconds to wait for response.
|
|
url
string
|
success |
URL of the oVirt/RHV engine API endpoint.
Sample:
https://ovirt.example.com/ovirt-engine/api
|
|
insecure
bool
|
success |
Flag indicating if insecure connection is used.
|
|
kerberos
bool
|
success |
Flag indicating if kerberos is used for authentication.
|
|
compress
bool
|
success |
Flag indicating if compression is used for connection.
Sample:
True
|
|
headers
dict
|
success |
Dictionary of HTTP headers to be added to each API call.
|
|
token
string
|
success |
SSO token which is used for connection to oVirt/RHV engine.
Sample:
kdfVWp9ZgeewBXV-iq3Js1-xQJZPSEQ334FLb3eksoEPRaab07DhZ8ED8ghz9lJd-MQ2GqtRIeqhvhCkrUWQPw
|
|
ca_file
path
|
success |
CA file, which is used to verify SSL/TLS connection.
Sample:
ca.pem
|
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
Hint
If you notice any issues in this documentation you can edit this document to improve it.