Skip to content

Commit

Permalink
Update hpilo_facts.py (ansible#24503)
Browse files Browse the repository at this point in the history
* 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()
  • Loading branch information
bushvin authored and ansibot committed Jul 13, 2017
1 parent b49be56 commit ae3a6cd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/ansible/modules/remote_management/hpilo/hpilo_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
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:
Expand Down Expand Up @@ -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,
)
Expand All @@ -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,
Expand Down

0 comments on commit ae3a6cd

Please sign in to comment.