mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Update hpilo_facts.py (#24503)
* Update hpilo_facts.py Add option to change the ssl version used to connect to the remote iLO * Update hpilo_facts.py addition of spaces after commas in lists and replace()
This commit is contained in:
parent
b49be56c5b
commit
ae3a6cd931
1 changed files with 9 additions and 1 deletions
|
@ -47,6 +47,12 @@ options:
|
||||||
description:
|
description:
|
||||||
- The password to authenticate to the HP iLO interface.
|
- The password to authenticate to the HP iLO interface.
|
||||||
default: admin
|
default: admin
|
||||||
|
ssl_version:
|
||||||
|
description:
|
||||||
|
- Change the ssl_version used.
|
||||||
|
default: TLSv1
|
||||||
|
choices: [ "SSLv3", "SSLv23", "TLSv1", "TLSv1_1", "TLSv1_2" ]
|
||||||
|
version_added: '2.4'
|
||||||
requirements:
|
requirements:
|
||||||
- hpilo
|
- hpilo
|
||||||
notes:
|
notes:
|
||||||
|
@ -158,6 +164,7 @@ def main():
|
||||||
host = dict(required=True, type='str'),
|
host = dict(required=True, type='str'),
|
||||||
login = dict(default='Administrator', type='str'),
|
login = dict(default='Administrator', type='str'),
|
||||||
password = dict(default='admin', type='str', no_log=True),
|
password = dict(default='admin', type='str', no_log=True),
|
||||||
|
ssl_version = dict(default='TLSv1', choices=['SSLv3', 'SSLv23', 'TLSv1', 'TLSv1_1', 'TLSv1_2']),
|
||||||
),
|
),
|
||||||
supports_check_mode=True,
|
supports_check_mode=True,
|
||||||
)
|
)
|
||||||
|
@ -168,8 +175,9 @@ def main():
|
||||||
host = module.params['host']
|
host = module.params['host']
|
||||||
login = module.params['login']
|
login = module.params['login']
|
||||||
password = module.params['password']
|
password = module.params['password']
|
||||||
|
ssl_version = getattr(hpilo.ssl, 'PROTOCOL_' + module.params.get('ssl_version').upper().replace('V', 'v'))
|
||||||
|
|
||||||
ilo = hpilo.Ilo(host, login=login, password=password)
|
ilo = hpilo.Ilo(host, login=login, password=password, ssl_version=ssl_version)
|
||||||
|
|
||||||
facts = {
|
facts = {
|
||||||
'module_hw': True,
|
'module_hw': True,
|
||||||
|
|
Loading…
Reference in a new issue