Skip to content
Snippets Groups Projects
  1. 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
  2. Jul 27, 2022
  3. 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
  4. Jul 21, 2022
  5. Jul 20, 2022
    • Arx Cruz's avatar
      Update port info · 960e5df1
      Arx Cruz authored
      Make it compatible with new openstack sdk 1.0.0
      
      Change-Id: I911eecd31ee69dbde1da02a74e152746c1e3edfa
      960e5df1
  6. Jul 19, 2022
  7. Jul 15, 2022
    • Jakob Meng's avatar
      Replaced code in routers_info module with openstacksdk function · 1f5a2019
      Jakob Meng authored
      Replaced custom code for interface listing with call to openstacksdk.
      The original idea was to reduce the number of calls to the OpenStack
      API but this kind of optimization is better to be implemented in the
      SDK itself [1]. Reimplementing code like this increases our
      maintenance burden, does not help other SDK users and increases the
      likeliness of bugs. For example, variable allowed_device_owners
      introduced a bug, it is not 'network_router_interface_distributed'
      but 'network:router_interface_distributed'.
      
      [1] https://review.opendev.org/c/openstack/openstacksdk/+/849967
      
      Change-Id: I9c52de03c53ef29d7cecdf26253c0c00a7cf3689
      1f5a2019
  8. Jul 12, 2022
  9. Jul 06, 2022
  10. Jul 05, 2022
  11. Jul 04, 2022
  12. Jun 29, 2022
  13. Jun 28, 2022
    • Rafael Castillo's avatar
      Update image for new sdk · 2419b5ab
      Rafael Castillo authored
      - Use proxy layer where possible
        - Image upload has some tricky logic so that stays in the cloud layer
      - Convert return value to dict
      - Document return values
      - Update visibility logic for glance v2 api
      - Increase test coverage
      - General refactoring to bring more in line with rest of collection
      - Deprecate is_public attribute which has been replaced with
        visibility.
      - Deprecate volume attribute which has been made obsolete with
        openstack.cloud.volume module. Removed examples showing the volume
        attribute since users are encouraged to use openstack.cloud.volume
        module.
      
      Change-Id: I1d8034a3b9a391444ea275b68b06ee3a291c73c3
      2419b5ab
  14. Jun 27, 2022
  15. Jun 23, 2022
    • Arx Cruz's avatar
      Update project_info module to new sdk · bcca2efe
      Arx Cruz authored
      Make project_info module compatible with the new sdk 1.0.0 and also add
      ansible tests for project_info module
      
      Change-Id: I413200cf6a9b8bada7e5d78087246b888d53fac2
      bcca2efe
  16. Jun 17, 2022
    • Jan Horstmann's avatar
      Return details in baremetal_node_info when iterating over all machines · 9b62cd77
      Jan Horstmann authored
      Without any parameters supplied openstack.cloud.baremetal_node_info is
      supposed to gather and return information about all nodes.
      This is done with a call to cloud.list_machines(), which itself calls
      self.baremetal.nodes().
      Unfortunately this will not return detailed information about each
      machine as the details parameter of self.baremetal.nodes() defaults to
      false.
      This commit rewrites the module to use the baremetal service proxy of
      openstacksdk to get machines with details and converts them using the
      `to_dict()` method.
      
      Story: 2010017
      Task: 45207
      Change-Id: Ib06aea5f59f799d6ed81b30264c8a168301c1a9b
      9b62cd77
  17. Jun 16, 2022
  18. Jun 14, 2022
  19. Jun 08, 2022
    • Arx Cruz's avatar
      Update catalog service for the new sdk · 7c7e61d3
      Arx Cruz authored
      This patch do the following:
      
      * Update catalog_service to use new openstacksdk
      * Add catalog_service role to test catalog_service module
      
      Change-Id: I6778f5e91cb0ead63cede28af0111d7ffbbf3ab1
      7c7e61d3
  20. Jun 02, 2022
  21. Jun 01, 2022
    • Rafael Castillo's avatar
      Correctly build params dict in recordset · d6cdad2c
      Rafael Castillo authored
      Change If8fda40780050d271c9d869d8959ef569644fd88 unintentionally broke
      our integration tests. This patch fixes the code and tests to make
      everything pass again.
      
      Change-Id: Ief8d1f9e1eec13a2d435e96a0d70e31a2b4431f2
      d6cdad2c
  22. May 31, 2022
  23. May 25, 2022
  24. May 24, 2022
    • Jakob Meng's avatar
      Raise minimum OpenStack SDK version to 0.99.0 · 4bfa135b
      Jakob Meng authored
      Alongside OpenStack SDK 1.0.0 we will release a new collection version
      2.0.0 which is compatible to OpenStack SDK 1.x.x series only. Code in
      branch stable/1.0.0 will remain compatible to OpenStack SDK 0.x.x
      series only. Release candidates for the first major release of
      OpenStackSDK 1.x.x will be numbered using 0.99.x versions.
      
      At Ansible OpenStack modules PTG on 2022-04-07 it was decided to raise
      an error if one is using a incompatible releases of the OpenStack SDK
      with our collection. We decided against showing warnings only because
      they can be missed easily and functionality  will be broken but
      probably hardly detectable when using the wrong SDK.
      
      This patch bumps the minimum required SDK versions to 0.99.0, so that
      an error will be raised when users try to use our collection with an
      incompatible SDK release, e.g. use code from our master branch with
      a OpenStack SDK 0.x.x release.
      
      Change-Id: I3974deabc516379745794806886352279dc4f4a7
      4bfa135b
  25. May 11, 2022
    • Arx Cruz's avatar
      Update identity_group_info to new sdk · a6805cd0
      Arx Cruz authored
      The following changes were made:
      
      * Update identity_group_info to use the new openstacksdk
      * Added identity_group_info role to test the module
      
      Change-Id: I24e64c9455618952ee612d7413882f0ac022189f
      a6805cd0
  26. May 10, 2022
    • Jan Horstmann's avatar
      Set owner in image module · 80ef2093
      Jan Horstmann authored
      Previously the owner field was not set by module
      `cloud.openstack.image`, although it is specified as a module parameter.
      The usual approach in `ansible-collections-openstack` is to accept both
      names and IDs when referencing openstack resources.
      Therefore this commit follows the approach taken by
      `python-openstackclient` in [1] and introduces a `project` and a
      `project_domain` parameter to identify projects by name or ID and
      assign the ID to the `owner` attribute of the image.
      The `owner` parameter is left as an alias to `project` in the module.
      
      Story: 2009983
      Task: 45012
      
      [1]
      https://opendev.org/openstack/python-openstackclient/commit/cf2de9af79cedd51ca080f5a6521997c05647418
      
      Change-Id: I3654587df8e40d554aac5126df307961f335332c
      (cherry picked from commit acf64a1f72bf10e0e332899168e468db5c8ba034)
      80ef2093
  27. May 09, 2022
    • anbanerj's avatar
      Moves image_info from cloud to proxy object · c1a97942
      anbanerj authored
      This makes image_info compatible with new sdk version
      - This patch changes get_image (which is a cloud object method) to image.get_image (proxy object method)
      - image.images accepts **query which is a dict object. So this patch changes the args passed to a dict. If properties is not specified it passes an empty dict.
      - updates the documentation to reflect the actual returned parameters
      - adds a ci test to list all images without specifying image name or property and assert no field is missing
      - changes openstack_image to image in ansible return value
      
      Change-Id: Ibf934568f069c305747fc24fbb22ce3fc095286c
      c1a97942
    • Rafael Castillo's avatar
      Update identity_role_info for latest openstacksdk release · 1d22a94a
      Rafael Castillo authored
      - Stop checking for to_dict, breaking compatibility with older sdk
        releases
      - Updates RETURN doc string with all the returned fields
      - Adds a new identity_role_info role to test the identity_role_info
        module.
      - Change the name of the module return value to remove 'openstack_'
        prefix
      
      Change-Id: If8a1145a31d685d41367383930e6fd08d64c6ae8
      1d22a94a
    • Jakob Meng's avatar
      Reverted identity_user_info from identity.users() to search_users() · fdf49997
      Jakob Meng authored
      Commit 2df07f35 changed module identity_user_info to use function
      identity.users() instead of search_users(). The first does not allow
      to search for id with parameter name while the previous and current
      search_users() function has a name_or_id parameter which allows to
      search by name and id.
      
      Ref.: https://opendev.org/openstack/ansible-collections-openstack/commit/2df07f3523ba3281d84c93083bc3b5d1791afb4b
      
      Change-Id: I71226e578a234d24e068a256cf4a5533ccd4c201
      fdf49997
    • Rafael Castillo's avatar
      Refactored identity_domain_info · b31fdf83
      Rafael Castillo authored
      Switch to SDK's cloud layer function search_domains which allows
      us to reduce our code. Added integration test for this module.
      
      Change-Id: Ic7915fd3334266783ea5e9d442ef304fa734ca00
      b31fdf83
  28. May 05, 2022
  29. May 04, 2022
    • Rafael Castillo's avatar
      Use proxy layer in identity_user_info · 2df07f35
      Rafael Castillo authored
      - Changes the module to get user through proxy layer
      - Adds a role to test the module
      - Renames the return value to drop openstack_ prefix
      
      Change-Id: I99e98a529ce74ff2ca77a67d09f188228e6a0e37
      2df07f35
Loading