From 267d0fb400506e52dab94b487db0d217b9f12d46 Mon Sep 17 00:00:00 2001 From: William Leemans Date: Thu, 13 Jul 2017 19:48:03 +0200 Subject: [PATCH] Update hpilo_boot.py (#24499) * Update hpilo_boot.py Add option to change the ssl version to connect to the remotr iLO * Update hpilo_boot.py added version_added * Update hpilo_boot.py fix lib/ansible/modules/remote_management/hpilo/hpilo_boot.py:83:25: W291 trailing whitespace * Update hpilo_boot.py nitpicking fixes :) --- .../modules/remote_management/hpilo/hpilo_boot.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/remote_management/hpilo/hpilo_boot.py b/lib/ansible/modules/remote_management/hpilo/hpilo_boot.py index 28c1813c0bb..9e8797d68aa 100755 --- a/lib/ansible/modules/remote_management/hpilo/hpilo_boot.py +++ b/lib/ansible/modules/remote_management/hpilo/hpilo_boot.py @@ -75,6 +75,12 @@ options: - As a safeguard, without force, hpilo_boot will refuse to reboot a server that is already running. default: no choices: [ "yes", "no" ] + 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: @@ -134,6 +140,7 @@ def main(): image = dict(default=None, type='str'), state = dict(default='boot_once', type='str', choices=['boot_always', 'boot_once', 'connect', 'disconnect', 'no_boot', 'poweroff']), force = dict(default=False, type='bool'), + ssl_version = dict(default='TLSv1', choices=['SSLv3', 'SSLv23', 'TLSv1', 'TLSv1_1', 'TLSv1_2']), ) ) @@ -147,8 +154,9 @@ def main(): image = module.params['image'] state = module.params['state'] force = module.params['force'] + 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) changed = False status = {} power_status = 'UNKNOWN'