Refactored baremetal_node and baremetal_node_info modules
Added integration tests for both modules. They will not run in CI atm, because we do not have Ironic enabled in our DevStack environment. Sorted argument specs and documentation of both modules. Refactored both modules to be subclasses of OpenStackModule class. Renamed baremetal_node_info's module attribute 'node' to 'name' and added the former as an alias to be consistent with other *_info modules. baremetal_node_info will no longer fetch port and portgroup details because this requires extra api calls for each node. Users can use the baremetal_port module to retrieve ports for each node on demand. Refactored code for constructing node updates in baremetal_node module which allowed us to drop the dependency on Python module jsonpatch. Deprecated baremetal_node's skip_update_of_masked_password attribute. Updating or even specificing passwords for nodes has not been supported for a while now, rendering the attribute useless. Renamed baremetal_node's module attributes 'chassis_uuid' to 'chassis_id', 'uuid' to 'id' as well as suboptions of 'properties' to match openstacksdk. Added the previous attribute names as aliases to keep backward compatibility. Marked nics attribute in baremetal_node as not updatable. Changed baremetal_node module to return attribute 'node' only when state is present. It will return no values (except Ansible's default values) when state is absent. Previous return value 'uuid' can be retrieved from node's dictionary entry 'id'. The non-standard return value 'result' has been dropped because its content can easily be reconstructed with Ansible's is changed check. The non-standard return value 'changes' has been dropped because it was only returned on updates, has no known uses and can easily be reconstructed in Ansible by comparing the returned node dictionary with a copy of a previous node dictionary. Module baremetal_node_info will no longer fail when no node with a matching id or name or mac could be found. Instead it will return an empty list like other *_info modules. baremetal_node_info's return attribute 'baremetal_nodes' has been renamed to 'nodes' to be consistent with other modules. The former name will keep to be available for now to keep backward compatibility. Both modules convert their return values into dictionaries without computed (redundant) values. They do not drop values such as links anymore though, because we do not withhold information from users. Updated DOCUMENTATION, EXAMPLES and RETURN docstrings in both modules. Dropped deprecated ironic_url attribute from DOCUMENTATION docstring in baremetal_info. Dropped wait attribute from DOCUMENTATION because its docstring will be added via documentation fragment. Kept timeout attribute in DOCUMENTATION and argument_spec because it has a high(er) default value, to account for long provisioning times, than what e.g. the generic doc fragment specifies. Change-Id: If3044acf672295e9b61fa60d0969f47cd06dfdeb
Showing
- ci/roles/baremetal_node/defaults/main.yml 56 additions, 0 deletionsci/roles/baremetal_node/defaults/main.yml
- ci/roles/baremetal_node/tasks/main.yml 74 additions, 0 deletionsci/roles/baremetal_node/tasks/main.yml
- plugins/modules/baremetal_node.py 578 additions, 321 deletionsplugins/modules/baremetal_node.py
- plugins/modules/baremetal_node_info.py 83 additions, 287 deletionsplugins/modules/baremetal_node_info.py
Loading
Please register or sign in to comment