From 2f8001a7afcd5575c155e2f4e4bd56a2b75dd6a4 Mon Sep 17 00:00:00 2001 From: Chandra Shekar Rangavajjula <36447472+sekharvajjula@users.noreply.github.com> Date: Wed, 12 Dec 2018 19:07:44 +0200 Subject: [PATCH] Fixes 36950. Added support for missing options capabilities and root_device in properties of os_ironic.py ansible module (#37113) * Fix for 36950. Added support for missing options capabilities and root_device in properties of os_ironic.py ansible module * Updated docstring to pass documentation validation * Updated review comments from juliakreger * version_added: "2.8" --- .../modules/cloud/openstack/os_ironic.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/ansible/modules/cloud/openstack/os_ironic.py b/lib/ansible/modules/cloud/openstack/os_ironic.py index 6b251235eec..cdd36b83dea 100644 --- a/lib/ansible/modules/cloud/openstack/os_ironic.py +++ b/lib/ansible/modules/cloud/openstack/os_ironic.py @@ -93,6 +93,20 @@ options: description: - size of first storage device in this machine (typically /dev/sda), in GB default: 1 + capabilities: + description: + - special capabilities for the node, such as boot_option, node_role etc + (see U(https://docs.openstack.org/ironic/latest/install/advanced.html) + for more information) + default: "" + version_added: "2.8" + root_device: + description: + - Root disk device hints for deployment. + (see U(https://docs.openstack.org/ironic/latest/install/include/root-device-hints.html) + for allowed hints) + default: "" + version_added: "2.8" skip_update_of_driver_password: description: - Allows the code that would assert changes to nodes to skip the @@ -120,6 +134,9 @@ EXAMPLES = ''' cpu_arch: "x86_64" ram: 8192 disk_size: 64 + capabilities: "boot_option:local" + root_device: + wwn: "0x4000cca77fc4dba1" nics: - mac: "aa:bb:cc:aa:bb:cc" - mac: "dd:ee:ff:dd:ee:ff" @@ -149,6 +166,8 @@ def _parse_properties(module): cpus=p.get('cpus') if p.get('cpus') else 1, memory_mb=p.get('ram') if p.get('ram') else 1, local_gb=p.get('disk_size') if p.get('disk_size') else 1, + capabilities=p.get('capabilities') if p.get('capabilities') else '', + root_device=p.get('root_device') if p.get('root_device') else '', ) return props