Preparing overcloud templates files.
diff --git a/31-overcloud-network.yml b/31-overcloud-network.yml
deleted file mode 100644
index 88f8aa4..0000000
--- a/31-overcloud-network.yml
+++ /dev/null
@@ -1,38 +0,0 @@
----
-- hosts: undercloud
-  become: true
-  become_user: stack
-
-  vars:
-    home: /home/stack
-    subnet_name: ctlplane-subnet
-    dns_nameservers: 192.168.122.1
-
-  tasks:
-
-    - name: Create templates directories
-      file:
-        path: '{{ item.dest }}'
-        state: directory
-      with_items:
-        - src: /usr/share/openstack-tripleo-heat-templates/newton
-          dest: '{{ home }}/templates'
-        - src: /usr/share/openstack-tripleo-heat-templates/network/config/bond-with-vlans
-          dest: '{{ home }}/templates/nic-configs'
-      register: create_template_directory
-
-    - name: Copy template directories
-      shell: |
-        cp -r {{ item.src }}/* '{{ item.dest }}'
-      with_items: >
-        {{
-          create_template_directory.results|
-          selectattr('changed')|
-          map(attribute='item')|
-          list
-        }}
-
-    - name: Create network environment template
-      copy:
-        src: undercloud/templates/network-environment.yaml
-        dest: '{{ home }}/templates/network-environment.yaml'
diff --git a/31-overcloud-templates.yml b/31-overcloud-templates.yml
new file mode 100644
index 0000000..9376ae6
--- /dev/null
+++ b/31-overcloud-templates.yml
@@ -0,0 +1,95 @@
+---
+- hosts: undercloud
+  become: true
+  become_user: stack
+
+  vars:
+    home: /home/stack
+    subnet_name: ctlplane-subnet
+    dns_nameservers: 192.168.122.1
+    src_templates_dir: /usr/share/openstack-tripleo-heat-templates
+    templates_dir: '{{ home }}/templates'
+
+  tasks:
+
+    - name: Create templates directories
+      file:
+        path: '{{ item.dest }}'
+        state: directory
+      with_items:
+        - src: /usr/share/openstack-tripleo-heat-templates/newton
+          dest: '{{ templates_dir }}'
+        - src: /usr/share/openstack-tripleo-heat-templates/network/config/bond-with-vlans
+          dest: '{{ templates_dir }}/nic-configs'
+      register: create_template_directory
+
+    - name: Copy template directories
+      shell: |
+        cp -r {{ item.src }}/* '{{ item.dest }}'
+      with_items: >
+        {{
+          create_template_directory.results|
+          selectattr('changed')|
+          map(attribute='item')|
+          list
+        }}
+      register: copy_template_directories
+
+    - name: Copy environment template files
+      copy:
+        src: 'undercloud/templates/{{ item }}'
+        dest: '{{ templates_dir }}/{{ item }}'
+      with_items:
+        - network-environment.yaml
+        - nic-configs/controller.yaml.patch
+        - HostnameMap.yaml
+        - ips-from-pool-all.yaml
+
+    - when: >
+        (
+          copy_template_directories.results|
+          selectattr('changed')|
+          map(attribute='item')|
+          selectattr('dest', 'equalto', templates_dir + '/nic-configs')|
+          list|
+          length
+        ) > 0
+      block:
+
+        - name: Patch nic-configs controller template file
+          shell: |
+            patch -p0 '{{ templates_dir }}/nic-configs/controller.yaml.patch'
+
+        - name: Patch nic-configs other template files
+          shell: |
+            for Y in {{ templates_dir }}/nic-configs/*.yaml; do \
+              sed -i 's/type: ovs_bond/type: linux_bond/' "${Y}"
+              sed -i 's/ovs_options:/bonding_options:/' "${Y}"
+            done
+
+    - when: >
+        (
+          copy_template_directories.results|
+          selectattr('changed')|
+          map(attribute='item')|
+          selectattr('dest', 'equalto', templates_dir)|
+          list|
+          length
+        ) > 0
+      block:
+
+        - name: Create storage environment file
+          shell: |
+            cp \
+              /usr/share/openstack-tripleo-heat-templates/environments/storage-environment.yaml \
+              '{{ templates_dir }}'
+            sed \
+              -i 's#../puppet/services#/usr/share/openstack-tripleo-heat-templates/puppet/services#' \
+              '{{ templates_dir }}/storage-environment.yaml'
+            cat << EOF >> '{{ templates_dir }}/storage-environment.yaml'
+
+            ExtraConfig:
+              ceph::profile::params::osds:
+                '/dev/vdb': {}
+
+            EOF
diff --git a/main.yml b/main.yml
index 2ff6be2..b690c4c 100644
--- a/main.yml
+++ b/main.yml
@@ -11,7 +11,7 @@
 - import_playbook: 21-overcloud-instack.yml
 
 - import_playbook: 30-overcloud-pre-deploy.yml
-- import_playbook: 31-overcloud-network.yml
+- import_playbook: 31-overcloud-templates.yml
 - import_playbook: 32-overcloud-deploy.yml
 
 - import_playbook: 40-overcloud-network.yml
diff --git a/undercloud/templates/HostnameMap.yaml b/undercloud/templates/HostnameMap.yaml
new file mode 100644
index 0000000..3a9492a
--- /dev/null
+++ b/undercloud/templates/HostnameMap.yaml
@@ -0,0 +1,10 @@
+parameter_defaults:
+  HostnameMap:
+    overcloud-controller-0: lab-controller01
+    overcloud-controller-1: lab-controller02
+    overcloud-controller-2: lab-controller03
+    overcloud-compute-0: lab-compute01
+    overcloud-compute-1: lab-compute02
+    overcloud-cephstorage-0: lab-ceph01
+    overcloud-cephstorage-1: lab-ceph02
+    overcloud-cephstorage-2: lab-ceph03
diff --git a/undercloud/templates/ips-from-pool-all.yaml b/undercloud/templates/ips-from-pool-all.yaml
new file mode 100644
index 0000000..b29048f
--- /dev/null
+++ b/undercloud/templates/ips-from-pool-all.yaml
@@ -0,0 +1,103 @@
+# Environment file demonstrating how to pre-assign IPs to all node types
+resource_registry:
+  OS::TripleO::Controller::Ports::ExternalPort: /usr/share/openstack-tripleo-heat-templates/network/ports/external_from_pool.yaml
+  OS::TripleO::Controller::Ports::InternalApiPort: /usr/share/openstack-tripleo-heat-templates/network/ports/internal_api_from_pool.yaml
+  OS::TripleO::Controller::Ports::StoragePort: /usr/share/openstack-tripleo-heat-templates/network/ports/storage_from_pool.yaml
+  OS::TripleO::Controller::Ports::StorageMgmtPort: /usr/share/openstack-tripleo-heat-templates/network/ports/storage_mgmt_from_pool.yaml
+  OS::TripleO::Controller::Ports::TenantPort: /usr/share/openstack-tripleo-heat-templates/network/ports/tenant_from_pool.yaml
+  # Management network is optional and disabled by default
+  #OS::TripleO::Controller::Ports::ManagementPort: /usr/share/openstack-tripleo-heat-templates/network/ports/management_from_pool.yaml
+
+  OS::TripleO::Compute::Ports::ExternalPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
+  OS::TripleO::Compute::Ports::InternalApiPort: /usr/share/openstack-tripleo-heat-templates/network/ports/internal_api_from_pool.yaml
+  OS::TripleO::Compute::Ports::StoragePort: /usr/share/openstack-tripleo-heat-templates/network/ports/storage_from_pool.yaml
+  OS::TripleO::Compute::Ports::StorageMgmtPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
+  OS::TripleO::Compute::Ports::TenantPort: /usr/share/openstack-tripleo-heat-templates/network/ports/tenant_from_pool.yaml
+  #OS::TripleO::Compute::Ports::ManagementPort: /usr/share/openstack-tripleo-heat-templates/network/ports/management_from_pool.yaml
+
+  OS::TripleO::CephStorage::Ports::ExternalPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
+  OS::TripleO::CephStorage::Ports::InternalApiPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
+  OS::TripleO::CephStorage::Ports::StoragePort: /usr/share/openstack-tripleo-heat-templates/network/ports/storage_from_pool.yaml
+  OS::TripleO::CephStorage::Ports::StorageMgmtPort: /usr/share/openstack-tripleo-heat-templates/network/ports/storage_mgmt_from_pool.yaml
+  OS::TripleO::CephStorage::Ports::TenantPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
+  #OS::TripleO::CephStorage::Ports::ManagementPort: /usr/share/openstack-tripleo-heat-templates/network/ports/management_from_pool.yaml
+
+  OS::TripleO::SwiftStorage::Ports::ExternalPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
+  OS::TripleO::SwiftStorage::Ports::InternalApiPort: /usr/share/openstack-tripleo-heat-templates/network/ports/internal_api_from_pool.yaml
+  OS::TripleO::SwiftStorage::Ports::StoragePort: /usr/share/openstack-tripleo-heat-templates/network/ports/storage_from_pool.yaml
+  OS::TripleO::SwiftStorage::Ports::StorageMgmtPort: /usr/share/openstack-tripleo-heat-templates/network/ports/storage_mgmt_from_pool.yaml
+  OS::TripleO::SwiftStorage::Ports::TenantPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
+  #OS::TripleO::SwiftStorage::Ports::ManagementPort: /usr/share/openstack-tripleo-heat-templates/network/ports/management_from_pool.yaml
+
+  OS::TripleO::BlockStorage::Ports::ExternalPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
+  OS::TripleO::BlockStorage::Ports::InternalApiPort: /usr/share/openstack-tripleo-heat-templates/network/ports/internal_api_from_pool.yaml
+  OS::TripleO::BlockStorage::Ports::StoragePort: /usr/share/openstack-tripleo-heat-templates/network/ports/storage_from_pool.yaml
+  OS::TripleO::BlockStorage::Ports::StorageMgmtPort: /usr/share/openstack-tripleo-heat-templates/network/ports/storage_mgmt_from_pool.yaml
+  OS::TripleO::BlockStorage::Ports::TenantPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
+  #OS::TripleO::BlockStorage::Ports::ManagementPort: /usr/share/openstack-tripleo-heat-templates/network/ports/management_from_pool.yaml
+
+### VIPS ###
+
+  OS::TripleO::Network::Ports::NetVipMap: /usr/share/openstack-tripleo-heat-templates/network/ports/net_vip_map_external.yaml
+  OS::TripleO::Network::Ports::ExternalVipPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
+  OS::TripleO::Network::Ports::InternalApiVipPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
+  OS::TripleO::Network::Ports::StorageVipPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
+  OS::TripleO::Network::Ports::StorageMgmtVipPort: /usr/share/openstack-tripleo-heat-templates/network/ports/noop.yaml
+
+
+parameter_defaults:
+  ControllerIPs:
+    # Each controller will get an IP from the lists below, first controller, first IP
+    external:
+    - 192.168.122.201
+    - 192.168.122.202
+    - 192.168.122.203
+    internal_api:
+    - 172.17.1.201
+    - 172.17.1.202
+    - 172.17.1.203
+    storage:
+    - 172.17.3.201
+    - 172.17.3.202
+    - 172.17.3.203
+    storage_mgmt:
+    - 172.17.4.201
+    - 172.17.4.202
+    - 172.17.4.203
+    tenant:
+    - 172.17.2.201
+    - 172.17.2.202
+    - 172.17.2.203
+    #management:
+    #- 172.16.4.251
+  NovaComputeIPs:
+    # Each compute will get an IP from the lists below, first compute, first IP
+    internal_api:
+    - 172.17.1.211
+    - 172.17.1.212
+    storage:
+    - 172.17.3.211
+    - 172.17.3.212
+    tenant:
+    - 172.17.2.211
+    - 172.17.2.212
+    #management:
+    #- 172.16.4.252
+  CephStorageIPs:
+    # Each ceph node will get an IP from the lists below, first node, first IP
+    storage:
+    - 172.17.3.221
+    - 172.17.3.222
+    - 172.17.3.223
+    storage_mgmt:
+    - 172.17.4.221
+    - 172.17.4.222
+    - 172.17.4.223
+
+### VIPs ###
+
+  ControlPlaneIP: 172.16.0.250
+  ExternalNetworkVip: 192.168.122.150
+  InternalApiNetworkVip: 172.17.1.150
+  StorageNetworkVip: 172.17.3.150
+  StorageMgmtNetworkVip: 172.17.4.150
diff --git a/undercloud/templates/nic-configs/controller.yaml.patch b/undercloud/templates/nic-configs/controller.yaml.patch
new file mode 100644
index 0000000..42727c7
--- /dev/null
+++ b/undercloud/templates/nic-configs/controller.yaml.patch
@@ -0,0 +1,34 @@
+--- /usr/share/openstack-tripleo-heat-templates/network/config/bond-with-vlans/controller.yaml  2016-09-06 14:43:02.000000000 -0400
++++ /home/stack/templates/nic-configs/controller.yaml 2016-09-22 17:51:39.029122104 -0400
+@@ -117,6 +117,13 @@
+               type: ovs_bridge
+               name: {get_input: bridge_name}
+               dns_servers: {get_param: DnsServers}
++              addresses:
++                -
++                  ip_netmask: {get_param: ExternalIpSubnet}
++              routes:
++                -
++                  default: true
++                  next_hop: {get_param: ExternalInterfaceDefaultRoute}
+               members:
+                 -
+                   type: ovs_bond
+@@ -133,17 +140,6 @@
+                 -
+                   type: vlan
+                   device: bond1
+-                  vlan_id: {get_param: ExternalNetworkVlanID}
+-                  addresses:
+-                    -
+-                      ip_netmask: {get_param: ExternalIpSubnet}
+-                  routes:
+-                    -
+-                      default: true
+-                      next_hop: {get_param: ExternalInterfaceDefaultRoute}
+-                -
+-                  type: vlan
+-                  device: bond1
+                   vlan_id: {get_param: InternalApiNetworkVlanID}
+                   addresses:
+                     -