Execution
Date 08 Dec 2025 13:39:52 +0000
Duration 00:35:02.03
Controller aio1.openstack.local
User root
Versions
Ansible 2.18.6
ara 1.7.4 / 1.7.4
Python 3.12.3
Summary
2 Hosts
1377 Tasks
1365 Results
104 Plays
504 Files
0 Records

File: /etc/ansible/ansible_collections/openstack/osa/roles/openstack_resources/tasks/network_subnets.yml

---
# Copyright 2023, Cleura AB.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

- name: Creating subnets
  openstack.cloud.subnet:
    cloud: "{{ openstack_resources_cloud_name }}"
    interface: "{{ openstack_resources_interface }}"
    name: "{{ subnet['name'] }}"
    network: "{{ network_uuid }}"
    cidr: "{{ subnet['cidr'] | default(omit) }}"
    allocation_pool_start: "{{ subnet['allocation_start'] | default(omit) }}"
    allocation_pool_end: "{{ subnet['allocation_end'] | default(omit) }}"
    allocation_pools: "{{ subnet['allocation_pools'] | default(omit) }}"
    use_default_subnet_pool: "{{ subnet['use_default_subnet_pool'] | default(omit) }}"
    subnet_pool: "{{ subnet['subnet_pool'] | default(omit) }}"
    dns_nameservers: "{{ subnet['nameservers'] | default(omit) }}"
    enable_dhcp: "{{ subnet['dhcp'] | default(omit) }}"
    ipv6_address_mode: "{{ subnet['ipv6_address_mode'] | default(omit) }}"
    ipv6_ra_mode: "{{ subnet['ipv6_ra_mode'] | default(omit) }}"
    gateway_ip: "{{ subnet['gateway'] | default(omit) }}"
    ip_version: "{{ subnet['ip_version'] | default(omit) }}"
    project: "{{ network['project'] | default(omit) }}"
    state: "{{ subnet['state'] | default(omit) }}"
  loop: "{{ network['subnets'] }}"
  loop_control:
    loop_var: subnet
    label: "{{ loop_label | to_json }}"
  vars:
    network_uuid: "{{ _provisioned_networks['results'] | selectattr('network.name', 'eq', network['name']) | map(attribute='id') | first }}"
    loop_label:
      name: "{{ subnet['name'] }}"
      network_name: "{{ network['name'] }}"
      network_uuid: "{{ network_uuid }}"
      cidr: "{{ subnet['cidr'] | default('omit') }}"
      gateway_ip: "{{ subnet['gateway'] | default('omit') }}"