From 6287c98d6967d14519b844f1eed4f9d6d7d0be48 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Thu, 15 Oct 2015 20:16:20 -0400 Subject: [PATCH] Fix DHCP use case Corrects the variables defined for template expansion to have an empty default which allows for users to utilize the DHCP use case as well as an inventory driven from Ironic it's self. Change-Id: I71972e65570aa1e6245522bec6f6263a5d10396c Closes-Bug: #1506606 --- .../bifrost-configdrives-dynamic/tasks/main.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/playbooks/roles/bifrost-configdrives-dynamic/tasks/main.yml b/playbooks/roles/bifrost-configdrives-dynamic/tasks/main.yml index 5c22f6a39..7583beb93 100644 --- a/playbooks/roles/bifrost-configdrives-dynamic/tasks/main.yml +++ b/playbooks/roles/bifrost-configdrives-dynamic/tasks/main.yml @@ -32,15 +32,16 @@ local_action: template src=openstack_meta_data.json.j2 dest={{ variable_configdrive_location.stdout }}/{{ uuid }}/openstack/latest/meta_data.json - name: "Generate network_info" network_metadata: - ipv4_address: "{{ ipv4_address }}" - ipv4_gateway: "{{ ipv4_gateway }}" + ipv4_address: "{{ ipv4_address | default('') }}" + ipv4_gateway: "{{ ipv4_gateway | default('') }}" ipv4_interface_mac: "{{ ipv4_interface_mac | default('') }}" - ipv4_nameserver: "{{ ipv4_nameserver }}" - ipv4_subnet_mask: "{{ ipv4_subnet_mask }}" + ipv4_nameserver: "{{ ipv4_nameserver | default('') }}" + ipv4_subnet_mask: "{{ ipv4_subnet_mask | default('') }}" vlan_id: "{{ vlan_id | default('') }}" - network_mtu: "{{ network_mtu }}" - nics: "{{ nics }}" + network_mtu: "{{ network_mtu | default('1500') }}" + nics: "{{ nics | default('') }}" node_network_info: "{{ node_network_info | default('') }}" + when: addressing_mode is undefined and '"dhcp" not in addressing_mode' - name: "Place network info template in each openstack/latest folder" local_action: template src=network_info.json.j2 dest={{ variable_configdrive_location.stdout }}/{{ uuid }}/openstack/latest/network_info.json when: addressing_mode is undefined and '"dhcp" not in addressing_mode'