Skip to content
Snippets Groups Projects
  1. Oct 27, 2022
  2. Oct 26, 2022
  3. Oct 25, 2022
    • Jakob Meng's avatar
      Refactored baremetal_port and baremetal_port_info modules · 99074ccd
      Jakob Meng authored
      Sorted argument specs and documentation of both modules.
      
      Refactored both modules to be subclasses of OpenStackModule class.
      
      Renamed baremetal_port's module attributes 'uuid' to 'id' and
      'portgroup' to 'port_group' to match openstacksdk. Added the previous
      attribute names as aliases to keep backward compatibility. Added
      alias 'pxe_enabled' for 'is_pxe_enabled' which was previously set
      programmatically.
      
      Changed baremetal_port module to return attribute 'port' only when
      state is present. It will return no values (except Ansible's default
      values) when state is absent. Previous return value 'id' can be
      retrieved from port'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 its
      content was only returned on updates, has no known uses and can
      easily be reconstructed in Ansible by comparing the updated port
      dictionary with a copy of the pre-updated port dictionary.
      
      Module baremetal_port_info will no longer fail when no port with a
      matching id or name or address could be found. Instead it will return
      an empty list like other *_info modules.
      
      baremetal_port_info's return attribute 'baremetal_ports' has been
      renamed to 'ports' 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.
      
      Added integration tests for both modules. They will not run in CI atm,
      because we do not have Ironic enabled in our DevStack environment.
      
      Change-Id: I54b3ea9917fbbbdf381ef934a0d92e2857f6d51b
      99074ccd
    • Jakob Meng's avatar
      Refactored baremetal_node_action module · 65a7e74b
      Jakob Meng authored
      Sorted argument specs and documentation of the module.
      
      Refactored baremetal_node_action module to be a subclass of the
      OpenStackModule class.
      
      Redefined baremetal_node_info's module attributes 'id' and 'uuid'
      as aliases of the 'name' attribute because modules in this collection
      do not differentiate between ids and names. The previous revision of
      baremetal_node_info module had the same behaviour implemented but did
      not make the relationship between 'id'/'uuid' and 'name' explicit.
      
      Changed types and/or choices of module attributes 'deploy',
      'maintenance', 'power' and 'state' to match what has been described
      in DOCUMENTATION string and to get rid of the non-Ansible'ish and
      inconsistent parsing of input values in _is_true() and _is_false()
      functions. Ansible can handle argument types for us, no need to
      implement it ourselfs.
      
      Dropped deprecated ironic_url attribute from DOCUMENTATION docstring.
      Dropped wait and timeout attributes from DOCUMENTATION because their
      docstrings will be added via documentation fragment.
      
      Dropped attribute 'result' from module results because in our modules
      we consistently do not explain what we do in modules.
      
      Updated DOCUMENTATION, EXAMPLES and added RETURN docstrings.
      
      Refactored the change logic for maintenance, power state and state,
      eliminating unreachable or broken code.
      
      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 node
      (de)activiation times, than what e.g. the generic doc fragment
      specifies.
      
      Change-Id: I991f23c16583da106105677d75b3651959280d98
      65a7e74b
    • Jakob Meng's avatar
      Refactored baremetal_node and baremetal_node_info modules · 902b2f81
      Jakob Meng authored
      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
      902b2f81
  4. Oct 18, 2022
    • Artem Goncharov's avatar
      Do not enforce optional params in network module · f51898bd
      Artem Goncharov authored
      It is wrong to enforce values of optional networking parameters. In the
      clouds where those optional extensions are not installed this leads to
      failures. Instead only pass params down to SDK if user explicitly set
      them.
      
      Change-Id: I5660eb8a4a65dd365ae7ce8c09825bbed8d2fdde
      f51898bd
  5. Oct 14, 2022
  6. Oct 10, 2022
  7. Oct 07, 2022
  8. Oct 06, 2022
  9. Sep 30, 2022
  10. Sep 27, 2022
  11. Sep 23, 2022
  12. Sep 22, 2022
  13. Sep 21, 2022
  14. Sep 20, 2022
    • Will Szumski's avatar
      Allow networks to be updated · 2d0656f0
      Will Szumski authored
      Neutron will allow you to update certain properties of the network after
      creation. This change modifies the ansible code to perform an update
      call if it detects that any updatable properties have been changed. If
      you attempt to change a property that cannot be updated, the module will
      fail. This gives you confidence that the ansible configuration matches
      the state of the network in OpenStack. If we did not fail in this way,
      you might think you have updated the network, but in reality those
      changes would be silently ignored. Prior to this change, the only way to
      update properties of a network was to delete it and then recreate.
      
      Story: 2010024
      Task: 45262
      Change-Id: I4af2b50f207f349b58c63e0a4e92816ada0847fd
      2d0656f0
  15. Sep 09, 2022
  16. Sep 07, 2022
  17. Aug 28, 2022
  18. Aug 22, 2022
  19. Aug 16, 2022
  20. Aug 11, 2022
    • Rafael Castillo's avatar
      Update compute flavor module for 2.0.0 · 4df7a12e
      Rafael Castillo authored
      Switch sdk calls to use the proxy layer where sensible.
      
      Ensure that returned resource objects are converted to dicts.
      
      Removes undocumented id return value.
      
      Rename flavorid to id. Keep flavorid as an alias for backward
      compatibility.
      
      Rename the test role from nova_flavor to compute_flavor to keep naming
      consistent.
      
      Fold tests from compute_flavor_info into the compute_flavor role.
      
      Add additional tests to improve coverage.
      
      Update return docs
      
      Change-Id: I5419d1c02b9b50625beb3bff88c8e4a4f1c14667
      4df7a12e
    • Jakob Meng's avatar
      Dropped extra interfaces_info attribute from routers_info module · 0ec16fbe
      Jakob Meng authored
      routers_info's interfaces_info attribute is not provided by
      openstacksdk, it is added to each router resource by the routers_info
      module after retrieving the routers list. To get the required data
      list_router_interfaces() [1] is being called for each router resource
      which then retrieves all ports for each router. This requires extra
      api calls which might be useless because we do not know whether the
      user actually cares about the ports. For getting ports of a router
      we have the openstack.cloud.ports module. So instead of proactively
      retrieving the router ports we drop the interfaces_info attribute.
      
      The interfaces_info attribute was introduced because retrieving
      interfaces via openstacksdk and openstack.cloud modules was
      complex in the past [2]. Nowadays, using openstack.cloud.ports
      Ansible and Jinja2 filters retrieving ip addresses of a router
      is straight forward. In case someone still needs the old
      interfaces_info attribute, one can refer to the module example
      to see how it could be reproduced. But in general, retrieving the
      router interfaces is much easier as can be seen in the updated
      integration tests.
      
      [1] https://opendev.org/openstack/openstacksdk/src/commit/3f81d0001dd994cde990d38f6e2671ee0694d7d5/openstack/cloud/_network.py#L1926
      [2] https://review.opendev.org/c/openstack/ansible-collections-openstack/+/703927/6/plugins/modules/os_routers_info.py
      
      Change-Id: I7fbdf11d07c95421d3aee800bfeebb88ea829817
      0ec16fbe
  21. Aug 10, 2022
    • Rafael Castillo's avatar
      Update identity_group for 2.0.0 · 5e7c29d9
      Rafael Castillo authored
      Replace calls to the sdk cloud layer with proxy layer calls where
      appropriate.
      
      Ensure module return values are converted into dict.
      
      General refactoring to bring module more in line with collection
      conventions.
      
      Expand tests to assert idempotency and presence of return values.
      
      Rename test role to identity_group to match module name.
      
      Change-Id: I06fe28f77431bb151d85c8d9cd924a1634d85d98
      5e7c29d9
  22. Aug 08, 2022
    • Jakob Meng's avatar
      Refactored port and port_info modules · d0eb83e9
      Jakob Meng authored
      Define port's module attribute 'name' as a required attribute because
      this parameter is used to find, update and delete ports. Technically,
      a name is not required to create a port, but idempotency cannot be
      implemented without an identifier to refer to a port. In this
      collection we use resource names to find and identify resources. We
      do not offer a dedicated id attribute in most modules.
      
      Use port's module attribute 'network' when finding, creating,
      updating or deleting ports if the user provided this attribute.
      This allows to reduce ambiguity when equal names are used across
      different networks.
      
      Added 'description' parameter to port module.
      
      Renamed port's module attributes 'vnic_type' to 'binding_vnic_type'
      and 'admin_state_up' to 'is_admin_state_up' to match openstacksdk's
      attribute names which are used e.g. in module results. Added aliases
      for the old attribute names to keep backward compatibility.
      
      Renamed port_info's module attribute 'port' to 'name' and added
      the former as an alias to be consistent with other *_info modules.
      
      Dropped default=None and required=False from argument_spec of port
      module because those are the default in Ansible [1][2].
      
      Dropped 'id' field from port module's results to be consistent across
      other modules. Use 'port.id' instead.
      
      Sorted argument specs and documentation of the port module and
      marked attributes which are not updatable.
      
      Updated RETURN fields documentation for the module results of both
      port and port_info modules.
      
      Added integration tests to check the update mechanism of the port
      module.
      
      Added assertions for module results to catch future changes in the
      openstacksdk and our Ansible modules.
      
      Dropped openstacksdk version check since we require a recent release
      anyway.
      
      Fixed indentation in integration tests.
      
      Merged integration tests of port_info module into port module,
      because the former does not create any ports and assumes that
      ports have been created earlier.
      
      [1] https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_documenting.html
      [2] https://github.com/ansible/ansible/blob/61af59c8082cff068424d1012271daa0aac97288/lib/ansible/module_utils/common/parameters.py#L489
      
      
      
      Signed-off-by: default avatarJakob Meng <code@jakobmeng.de>
      Change-Id: Iacca78649f8e01ae95649d8d462f5d0a1740405e
      d0eb83e9
Loading