1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

[cloud] ovirt: add headers param to auth (#27881)

* Add filter param to ovirt module auth

* Update docs to include new filter param

* Fix broken YAML

* Replace filter param with headers
This commit is contained in:
Michele Zuccala 2017-08-11 15:31:20 +02:00 committed by Ryan Brown
parent 49209bfcc5
commit 7d1308b0d8
4 changed files with 17 additions and 0 deletions

View file

@ -143,6 +143,7 @@ def create_connection(auth):
insecure=auth.get('insecure', False),
token=auth.get('token', None),
kerberos=auth.get('kerberos', None),
headers=auth.get('headers', None),
)

View file

@ -84,6 +84,13 @@ options:
description:
- "A boolean flag indicating if Kerberos authentication
should be used instead of the default basic authentication."
headers:
required: False
description:
- "A dictionary of HTTP headers to be added to each API call."
version_added: "2.4"
requirements:
- python >= 2.7
- ovirt-engine-sdk-python >= 4.0.0
@ -168,6 +175,10 @@ ovirt_auth:
returned: success
type: bool
sample: False
headers:
description: Dictionary of HTTP headers to be added to each API call.
returned: success
type: dict
'''
import traceback
@ -192,6 +203,7 @@ def main():
timeout=dict(required=False, type='int', default=0),
compress=dict(required=False, type='bool', default=True),
kerberos=dict(required=False, type='bool', default=False),
headers=dict(required=False, type='dict'),
state=dict(default='present', choices=['present', 'absent']),
ovirt_auth=dict(required=None, type='dict'),
),
@ -218,6 +230,7 @@ def main():
timeout=params.get('timeout'),
compress=params.get('compress'),
kerberos=params.get('kerberos'),
headers=params.get('headers'),
token=params.get('token'),
)
try:
@ -233,6 +246,7 @@ def main():
timeout=params.get('timeout'),
compress=params.get('compress'),
kerberos=params.get('kerberos'),
headers=params.get('headers'),
) if state == 'present' else dict()
)
)

View file

@ -56,6 +56,7 @@ options:
CA certificate store is used. Default value is set by I(OVIRT_CAFILE) environment variable."
- "C(kerberos) - A boolean flag indicating if Kerberos authentication
should be used instead of the default basic authentication."
- "C(headers) - Dictionary of HTTP headers to be added to each API call."
timeout:
description:
- "The amount of time in seconds the module should wait for the instance to

View file

@ -53,6 +53,7 @@ options:
CA certificate store is used. Default value is set by I(OVIRT_CAFILE) environment variable."
- "C(kerberos) - A boolean flag indicating if Kerberos authentication
should be used instead of the default basic authentication."
- "C(headers) - Dictionary of HTTP headers to be added to each API call."
requirements:
- python >= 2.7
- ovirt-engine-sdk-python >= 4.0.0