With this change, multiple allocation pool may be specified when creating
a subnet. Allocation pools are defined as a list of dictionaries.
For example:
openstack.cloud.subnet:
name: sub1
network: network1
cidr: 192.168.0.0/24
ip_version: 4
allocation_pools:
- start: 192.168.0.10
end: 192.168.0.50
- start: 192.168.0.100
end: 192.168.0.150
Change-Id: I77a06990de082466dc6265a14c379b8bbaf789e8
Adds target_all_project option to neutron_rbac_policy
module, for specifing all projects as target projects
explicitly.
Change-Id: I1393463a79fc83bcda7aa5642f5d3ed27fb195b5
Add a way to filter which volume service is running on a host or list
which hosts run available volume services.
Closes-Bug: #2010490
Change-Id: Icb17f6019a61d9346472d83ddcd2ad29c340ea05
Glance images can be deactivated ad reactivated with corresponding
API calls. It might be useful for operators to be able to control
these states through ansible modules as well. Instead of introduction
of the new parameter we're adding new state for the image that is
`inactive`.
Change-Id: I0738ff564f81a31690872450a4731340ed6bbeb1
SDK does return all keys and values of the template labels as
strings. At the same time user can define some labels as integers or
booleans, which will break comparison of labels and lead to module
failure on consecutive runs.
Change-Id: I7ab624428c8bb06030a2b28888f5cb89bb249f08
This adds a Ansible module for managing a
Neutron trunk and the sub ports associated
with the trunk.
Change-Id: I0e1c6798b6cc30062c881d1f92fdd4d630d31106
A ValueError is raised when running the object_container module with the
`metadata` param against a container with existing metadata.
When the module attempts to enumerate the existing container metadata, a
ValueError exception is raised, because the code is iterating over the
metadata keys, instead of `dict_items`.
Compare to the iteration through another dict `metadata` on the next
line:
new_metadata = dict((k, v) for k, v in metadata.items()
This change adds a call to `items()` on the dictionary.
Note that this is added outside the parentheses so that the behaviour of the
`or` statement is not affected, and that another exception isn't caused
if `container.metadata` is not a dict.
Closes-Bug: #2071934
Change-Id: Ie5e1f275839e38340a75ab18c3b9ec9bc7745d68
When creating a new object from file, a AttributeError is raised.
This is caused because the sdk does not return anything when creating an
object from a file.
With this change, the `_create` function will always return an object.
Closes-Bug: #2061604
Change-Id: I34cefd1bb10c6eef784e37d26122e5ed2c72488d
I suspect that the change to `update_quota_set` in openstacksdk commit
[9145dce64](https://opendev.org/openstack/openstacksdk/commit/9145dcec64)
has caused a regession in the quota module, making it not work correctly
for volume and compute quotas.
This change updates the calls to `update_quota_set` with the new
signatures.
Closes-Bug: #2068568
Change-Id: I604a8ffb08a76c20397f43c0ed3b23ddb11e53eb
Create or delete a Keystone application credential. When the secret
parameter is not set a secret will be generated and returned in the
response. Existing credentials cannot be modified so running this module
against an existing credential will result in it being deleted and
recreated. This needs to be taken into account when the secret is
generated, as the secret will change on each run of the module.
The returned result also includes a usable cloud config which allows
playbooks to easily run openstack tasks using the credential created by
this module.
Change-Id: I0ed86dc8785b0e9d10cc89cd9137a11d02d03945
Specifying CIDR during creation of subnet from subnet pool is a valid
operation. Moreover, in case of use of a subnet pool with multiple
subnets, cidr is a mandatory paramter for creating subnet.
Following code should be valid:
- name: Create subnet
openstack.cloud.subnet:
name: "subnet_name"
network: "some_network"
gateway_ip: "192.168.0.1"
allocation_pool_start: "192.168.0.2"
allocation_pool_end: "192.168.0.254"
cidr: "192.168.0.0/24"
ip_version: 4
subnet_pool: "192.168.0.0/24"
This scenario is added as a subnet-pool.yaml test in the test role.
Change-Id: I1163ba34ac3079f76dd0b7477a80a2135985a650
Creating a port with a binding profile now requires a user with the
service role. This fixes CI by removing the tasks which create a port
with a binding profile. The new policy implies that only other openstack
services should be doing this. The capability can remain in the module,
but it is unlikely to be used unless with a custom or deprecated policy.
Change-Id: I89306d35670503d2fc8e76c030d88f64c20eca08
If a router is created in a specific project, the router module
tried to find its external network in the same project. This would fail
with 'No Network found for <network>' if the external network is in a
different project. This behaviour has changed, most likely in [1] when
the project scoping was added to the find_network function call.
This change modifies the network query to first check the project, then
fall back to a global search if the network is not found. This ensures
that if there are multiple networks with the name we will choose one in
the project first, while allowing use of a network in a different
project.
A regression test has been added to cover this case.
[1] 3fdbd56a58
Closes-Bug: #2049658
Change-Id: Iddc0c63a2ce3c500d7be2f8802f718a22f2895ae
The linters-devel job fails with:
ansible-test sanity: error: argument --skip-test: invalid choice:
'metaclass-boilerplate' (choose from 'action-plugin-docs', ...)
The functional test fails with:
The conditional check 'info1.volumes | selectattr("id", "equalto", "{{
info.volumes.0.id }}") | list | length == 1' failed. The error was:
Conditional is marked as unsafe, and cannot be evaluated.
This is due to a change in Ansible 2.17 preventing embedded templates
from referencing unsafe data [1].
[1] https://docs.ansible.com/ansible/latest/porting_guides/porting_guide_9.html#playbook
Change-Id: I2f8411cac1403568afb13c2b96ba452c4c81f126
At the moment `subnet` is an alias of `subnet_id`. The way, how aliases
work in ansible modules, is that ansible does add intended key to param
in case alias is used. When riginal key is used, aliases are not
populated.
Right now in case user define `subnet_id` instead of its alias `subnet`
module will fail with KeyError.
Change-Id: I5ce547352097ea821be4c9bbc18147575986c740
New module to manipulate volume type encryption. Including simple CI
task to verify functionality.
Change-Id: I7380a5d258c3df1f9bd512aa4295868294391e31
Added 2 new modules to manipulate volume types in OpenStack
* volume_type is used to create, delete and modify volume type
* volume_type_info is used to show volume_type details, including
encryption information
ci tests extended with additional role to test basic module behaviour
It is currently impossible to update is_public volume type attribute
as it is being changed to "os-volume-type-access:is_public" which is not
expected by api. Which expects just "is_public"
https://docs.openstack.org/api-ref/block-storage/v3/?expanded=update-a-volume-type-detail#update-a-volume-type
Which results in "'os-volume-type-access:is_public' was unexpected"
reply. I guess the change is required by openstacksdk or on the API side
Change-Id: Idc26a5240b5f3314c8384c7326d8a82dcc8c6171
At the moment we generate a set as a filter for image checksums which
lead to AttributeError in SDK:
'set' object has no attribute 'keys'
With that we ensure that supllying checksum does not cause
module crash.
Change-Id: I490f51950592f62c9ad81806593340779bf6dbdb
Security group rules in module openstack.cloud.security_group
are changed/updated only when option 'security_group_rules' was
defined explicitly. This follows our policy of "apply no change"
when module options in our Ansible modules have not been set.
Story: 2010691
Task: 47795
Change-Id: I4a0cda46cb160b5321913b63ff1123d8b8a19705
Story: #2010527
Task: #47136
Sort records in recordset so it can be compared to existing ones
and not to trigger update in case of a different order.
Change-Id: Ib5d2af56616532174c29ec2be86827ccd0a17940
YAML output of ansible-inventory does not guarantee which group will
actually populate hosts with all their host vars.
Change-Id: Ia7d46898b8e91bafff05873be2b3c92bc85d83d2