Skip to content
Snippets Groups Projects
  1. Oct 07, 2022
  2. Oct 06, 2022
  3. Sep 30, 2022
  4. Sep 27, 2022
  5. Sep 23, 2022
  6. Sep 22, 2022
  7. Sep 21, 2022
  8. 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
  9. Sep 09, 2022
  10. Sep 07, 2022
  11. Aug 28, 2022
  12. Aug 22, 2022
  13. Aug 16, 2022
  14. 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
  15. 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
  16. 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
    • Arx Cruz's avatar
      Update federation_idp_info module to use proxy layer · ce6193cd
      Arx Cruz authored
      This patch update federation_idp_info to use proxy layer as well as add
      the ansible role to test the module
      
      Change-Id: I6b4544cca317f2d5fab4a9612b820872b87585f4
      ce6193cd
  17. Aug 03, 2022
    • Jakob Meng's avatar
      Refactored router module · fdc67892
      Jakob Meng authored
      Expanded and fixed module results docs.
      
      Moved ext_ips_spec into the module class because global scope is not
      necessary. Renamed it to external_fixed_ips_spec to explain its
      purpose.
      
      Sorted argument_spec and attribute docs by attribute name and fixed
      indentations. Marked router attributes which cannot be updated.
      
      Mark network attribute as required by enable_snat and
      external_fixed_ips attributes. Fixed docstring of network attribute:
      Module attribute interfaces does not require the network attribute,
      its external_fixed_ips what requires network to be set.
      
      Changed examples from deprecated ip to current ip_address attribute.
      
      Dropped self.fail() calls and let openstacksdk handle missing networks,
      subnets.. instead because less code means less code to maintain.
      
      Limited line length to 80 chars to be consistent with other OpenStack
      projects. Personally, I prefer a 120 chars limit but consistency is more
      important.
      
      Added explanation in code comment why we cannot update a router's name.
      
      Moved upfront cleanup operations in router's integration tests to the
      beginning of the role.
      
      Assigned meaningful names to result variables
      in router's ci role to easily identify which modules produced the
      data.
      
      Added tests for router ids, admin state and interfaces.
      
      Change-Id: Icae77a43479fb4f0bae065d1c5d7942cb0f5fd6b
      fdc67892
  18. Aug 02, 2022
    • Rafael Castillo's avatar
      Update baremetal_inspect to be compatible with new sdk · d2eb98d0
      Rafael Castillo authored
      Refactors the module to be based off OpenstackModule.
      
      Changes sdk calls to use the proxy layer where appropriate. The
      inspection itself stays at the cloud layer to support waiting.
      
      Make sure we convert returned resource objects to dict
      
      Adds a barebones role to test the module. This won't run in CI, since
      we don't have the ironic plugin configured in devstack.
      
      Changes the return value of the module to be the entire node, instead of
      just the properties that resulted from inspection. Return docs were
      updated to reflect this.
      
      Update module params to use `name` as the identifier for the node,
      aliasing it to the previous supported values of `id` and `uuid`.
      
      Use module kwargs to specify mutually exclusive params.
      
      Stop catching exceptions and instead let them bubble up so ansible
      handles them.
      
      Change-Id: I2b07b58c8b068d7f18db9862fcecb4088328ac74
      d2eb98d0
  19. Aug 01, 2022
  20. Jul 28, 2022
    • Jakob Meng's avatar
      Refactored server and server_info modules · ac401bb3
      Jakob Meng authored
      Allow to update server attributes such as its description.
      
      Changed default value of server attribute 'security_groups' from
      ['default'] to [] because the latter is the default in
      python-openstackclient [1] and the former behavior causes issues
      with existing servers [2]: Previously, when no 'security_groups'
      parameter was given, the server module would change existing
      servers to use the default security group, dropping all other
      security groups assigned to the server.
      Our (undocumented) guideline when writing modules is to only
      add or change what has been requested by the user and to stick to
      defaults from openstacksdk and python-openstackclient whenever
      possible. Since we have to break backward compatibility with the
      next release anyway, we take this opportunity to clean up this odd
      behavior. Now, when no security groups are given, then security
      groups of an existing server will not be touched.
      Closes story #2007893 [2].
      Note, Nova will create a server in the default security group,
      if the security_groups parameter is omitted.
      
      Dropped 'openstack' field from server module's results. This
      variable expanded to additional server information which might
      be useful for Ansible inventories and was filled from
      openstacksdk's get_openstack_vars() function [3]. Variables in
      this function can make additional cloud queries to retrieve
      additional data, so calling this function can be expensive [4].
      Users can use *_info modules to retrieve this data on-demand.
      
      Dropped 'availabity_zone' attribute from generic OpenStackModule
      arguments and inserted it into server and volume modules because
      it is relevant to those two modules only. This is completes what
      was started years ago [5] and is possible now since we have
      breaking changes anyway.
      
      Switched attribute name 'userdata' with its alias 'user_data' to
      match openstacksdk's attribute names which are used e.g. in module
      results. The previous attribute name 'userdata' is now used as an
      alias and 'user_data' is used as the attribute name to keep backward
      compatibility.
      
      Wait for server to get into 'ACTIVE' state when creating a server
      and attribute 'wait' has been set to true.
      
      Sorted argument specs and documentation of the server module and
      marked attributes which are not updatable. Changed unstable bash
      script example in server module documentation.
      
      Renamed server's module attribute 'delete_fip' to 'delete_ips' to
      match openstacksdk and clarify that it includes all floating ip
      addresses of the server.
      
      Renamed server_info's module attribute 'server' to 'name' and added
      the former as an alias to be consistent with other *_info modules.
      
      Added RETURN fields documentation for the module results of both
      server and server_info modules.
      
      Added description and examples of how to use the 'filters' attribute
      of the server_info module. Closes story #2007873 [6].
      
      Removed 'openstack_' prefix from module results because the prefix is
      not consistently used across modules, is more to type without any
      benefit and removal of the prefix allows us to signal to users that
      their code for handling module results has to be updated. Many modules
      have different return values with openstacksdk >= 0.99.0 because it
      consistently uses resource proxies now.
      
      Added assertions for module results to catch future changes in the
      openstacksdk and our Ansible modules.
      
      Added integration tests to check the update mechanism of the server
      module.
      
      Fixed indentation in integration tests.
      
      Ensure proper creation and deletion of resources such as networks,
      subnets and servers in integration tests of server_action module.
      
      Renamed ci/roles/server/defaults/main.yaml to main.yml, removing the
      'a' in the file extension to be consistent with other filenames.
      
      Dropped deprecated function openstack_find_nova_addresses() and
      incorporated its code directly into the server module because it
      is not used anywhere else.
      
      [1] https://opendev.org/openstack/python-openstackclient/src/commit/e49ad1795b9dd57d5a82fb6f8f365fa20041cf29/openstackclient/compute/v2/server.py#L1070
      [2] https://storyboard.openstack.org/#!/story/2007893
      [3] https://opendev.org/openstack/openstacksdk/src/commit/9e9fc9879583943a08f854980cca5dfb3a5832f7/openstack/cloud/_compute.py#L1772
      [4] https://opendev.org/openstack/openstacksdk/src/commit/9e9fc9879583943a08f854980cca5dfb3a5832f7/openstack/cloud/meta.py#L482
      [5] https://github.com/ansible/ansible/commit/9bf33e56dd49e9478ba091a1ba12d17b7caeac24
      [6] https://storyboard.openstack.org/#!/story/2007873
      
      
      
      Signed-off-by: default avatarJakob Meng <code@jakobmeng.de>
      Change-Id: I2f955519a7e8c782b1dab8f94f7a019ed384b81d
      ac401bb3
    • Rafael Castillo's avatar
      Update router for 2.0.0 · 3fdbd56a
      Rafael Castillo authored
      - Change sdk calls to use proxies
      - Convert return values to
      - Update module docs
      - Change argspec to more closely match the new sdk (and therefore the
        API) without breaking backward compatibility
      
      Change-Id: I0f9bc573fd0c69cab65bd808145d628732bb0830
      3fdbd56a
    • Jakob Meng's avatar
  21. Jul 27, 2022
  22. Jul 25, 2022
  23. Jul 22, 2022
    • Dmitry Tantsur's avatar
      Remove deprecated stuff from baremetal_node · 2d60a045
      Dmitry Tantsur authored
      Change-Id: Ia9fbc5b136347145d1a7ddc2d874f014c06558ae
      2d60a045
    • Jakob Meng's avatar
      Dropped symbolic links and plugin routing for deprecated module names · b87ae7dc
      Jakob Meng authored
      With Ansible OpenStack collection 2.0.0 we break backward
      compatibility to older releases, mainly due to breaking changes
      coming with openstacksdk >=0.99.0. For example, results will change
      for most Ansible modules in this collection.
      
      We take this opportunity to drop the symbolic links with prefix
      os_ in plugins/modules and the plugin routing in meta/runtime.yml.
      This means users have to call modules of the Ansible OpenStack
      collection using their FQCN (Fully Qualified Collection Name) such
      as openstack.cloud.server. Short module names such as os_server
      will now raise an Ansible error. This also decreases the likelihood
      of incompatible Ansible code going undetected.
      
      Symbolic links were introduced to keep our collection backward
      compatible to user code which was written for old(er) Ansible releases
      which did not have support for collections and where OpenStack modules
      where named with a prefix os_ such as os_server which is nowadays
      known and stored as openstack.cloud.server.
      
      In Ansible aka ansible-base 2.10, a internal routing table
      lib/ansible/config/ansible_builtin_runtime.yml [1] was introduced which
      Ansible uses to resolve deprecated module names missing the FQCN (Fully
      Qualified Collection Name). Additionally, collections can define their
      own plugin routing table in meta/runtime.yml [2] which we did.
      
      In ansible-base 2.10 and ansible-core 2.11 or later, if a user uses a
      short module name and the collections keyword is not used, Ansible
      will first look in the internal routing table, get an FQCN, and then
      looks in the collection for that FQCN. If there is another routing
      entry for that new name in that collection's meta/runtime.yml,
      Ansible will continue with that redirect. If it does not find another
      redirect, Ansible will look for the plugin itself, so it will not
      find a redirect in the collection before looking at its internal
      redirects. Except if the user uses a FQCN, then it looks directly in
      that collection.
      
      Ansible 2.9 and 2.8 do not have any notion of these redirects with a
      plugin routing table, backward compatibility with deprecated os_*
      module names is solely achieved with symbolic links. Ansible releases
      older than 2.11 are EOL [3], so usage of os_* symlinks should reduce
      soon.
      
      [1] https://github.com/ansible/ansible/blob/devel/lib/ansible/config/ansible_builtin_runtime.yml
      [2] https://github.com/openstack/ansible-collections-openstack/blob/master/meta/runtime.yml
      [3] https://docs.ansible.com/ansible/devel/reference_appendices/release_and_maintenance.html
      
      Change-Id: I28cc05c95419b72552899c926721eb87fb6f0868
      b87ae7dc
  24. Jul 21, 2022
Loading