2017-02-14 09:34:37 +00:00
|
|
|
---
|
|
|
|
- name: Ensure IP addresses are allocated
|
2017-08-01 15:05:08 +00:00
|
|
|
hosts: seed-hypervisor:seed:overcloud
|
2017-12-19 14:42:18 +00:00
|
|
|
tags:
|
|
|
|
- ip-allocation
|
2017-02-14 09:34:37 +00:00
|
|
|
gather_facts: no
|
2017-08-22 14:00:47 +00:00
|
|
|
# Use serial=1 to avoid races between allocations for different hosts.
|
|
|
|
serial: 1
|
2017-02-14 09:34:37 +00:00
|
|
|
pre_tasks:
|
2017-02-16 10:44:29 +00:00
|
|
|
- name: Initialise the IP allocations fact
|
|
|
|
set_fact:
|
|
|
|
ip_allocations: []
|
|
|
|
|
|
|
|
- name: Update the IP allocations fact with IP allocation requests
|
|
|
|
set_fact:
|
|
|
|
ip_allocations: >
|
|
|
|
{{
|
|
|
|
ip_allocations +
|
|
|
|
[{
|
|
|
|
'net_name': item,
|
|
|
|
'cidr': item|net_cidr,
|
|
|
|
'allocation_pool_start': item|net_allocation_pool_start,
|
|
|
|
'allocation_pool_end': item|net_allocation_pool_end
|
|
|
|
}]
|
|
|
|
}}
|
2017-02-14 09:34:37 +00:00
|
|
|
with_items: "{{ network_interfaces }}"
|
2018-05-04 19:03:54 +01:00
|
|
|
when:
|
|
|
|
- item | net_cidr != None
|
|
|
|
- item | net_bootproto != 'dhcp'
|
2017-02-14 09:34:37 +00:00
|
|
|
roles:
|
|
|
|
- role: ip-allocation
|
|
|
|
ip_allocation_filename: "{{ kayobe_config_path }}/network-allocation.yml"
|
|
|
|
ip_allocation_hostname: "{{ inventory_hostname }}"
|