1
0
Fork 0
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:
William Leemans 2017-07-13 19:47:52 +02:00 committed by ansibot
parent b49be56c5b
commit ae3a6cd931

View file

@ -47,6 +47,12 @@ options:
description:
- The password to authenticate to the HP iLO interface.
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:
- hpilo
notes:
@ -158,6 +164,7 @@ def main():
host = dict(required=True, type='str'),
login = dict(default='Administrator', type='str'),
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,
)
@ -168,8 +175,9 @@ def main():
host = module.params['host']
login = module.params['login']
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 = {
'module_hw': True,