From 05063d79dc01f387136b2223447845a698bb5ac2 Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Mon, 20 Apr 2015 15:42:33 -0400 Subject: [PATCH] Adding support for future network configuration systems Added a basic template that can be parsed by glean or the future version of cloud-init, largely to allow a user to deploy a node without cloud-init. --- .../roles/bifrost-configdrives/tasks/main.yml | 4 +++ .../templates/network_info.json.j2 | 35 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 playbooks/roles/bifrost-configdrives/templates/network_info.json.j2 diff --git a/playbooks/roles/bifrost-configdrives/tasks/main.yml b/playbooks/roles/bifrost-configdrives/tasks/main.yml index dc663863a..52862ede7 100644 --- a/playbooks/roles/bifrost-configdrives/tasks/main.yml +++ b/playbooks/roles/bifrost-configdrives/tasks/main.yml @@ -34,6 +34,10 @@ local_action: template src=openstack_meta_data.json.j2 dest={{ variable_configdrive_location.stdout }}/{{item.split(',')[9]}}/openstack/latest/meta_data.json with_lines: - cat {{ baremetal_csv_file }} +- name: "Place network info template in each openstack/latest folder" + local_action: template src=network_info.json.j2 dest={{ variable_configdrive_location.stdout }}/{{item.split(',')[9]}}/openstack/latest/network_info.json + with_lines: + - cat {{ baremetal_csv_file }} - name: "Make Metadata folder - /openstack/latest" local_action: file state=directory name={{ variable_configdrive_location.stdout }}/{{item.split(',')[9]}}/openstack/content/ with_lines: diff --git a/playbooks/roles/bifrost-configdrives/templates/network_info.json.j2 b/playbooks/roles/bifrost-configdrives/templates/network_info.json.j2 new file mode 100644 index 000000000..be118a64d --- /dev/null +++ b/playbooks/roles/bifrost-configdrives/templates/network_info.json.j2 @@ -0,0 +1,35 @@ +{ +"links": [ + { + "id": "{{node_default_network_interface}}", + "type": "phy", + "ethernet_mac_address": "{{item.split(',')[0]}}", + "mtu":1500 + } +], +"networks": [ + { + "id": "publicnet-ipv", + "type": "ipv4", + "link": "{{ node_default_network_interface }}", + "ip_address": "{{item.split(',')[11]}}", + "netmask": "{{ipv4_subnet_mask}}", + "dns_nameservers": [ + "{{ipv4_nameserver}}" + ], + "routes": [ + { + "network": "0.0.0.0", + "netmask": "0.0.0.0", + "gateway": "{{ipv4_gateway}}" + } + ] + } +], +"services": [ + { + "type": "dns", + "address": "{{ipv4_nameserver}}" + } +] +}