Replace broken usage of first_private_address
authorClint Byrum <clint@fewbar.com>
Tue, 17 Sep 2013 00:29:24 +0000 (17:29 -0700)
committerClint Byrum <clint@fewbar.com>
Tue, 17 Sep 2013 18:05:59 +0000 (11:05 -0700)
The OpenStack native OS::Nova::Server gives us the full list of
networks rather than AWS::EC2::Instance's contrived view of 'private'
and 'public'. We know we want ctlplane, and use Fn::Select to choose
that network directly. The outer Fn::Select is meant to choose the
first network every time, which may not always be correct, but is at
this point.

Change-Id: Iae54ab8d9ac8d84f4f6e2f86ac1b66aacb687473

overcloud-source.yaml
undercloud-vm.yaml

index 3acaa19..2c9213a 100644 (file)
@@ -90,13 +90,13 @@ Resources:
     Path: nova-compute-instance.yaml
     SubKey: Resources.NovaCompute0Config
     Parameters:
-        NovaApiHost: {"Fn::GetAtt": [notcompute, first_private_address]}
-        KeystoneHost: {"Fn::GetAtt": [notcompute, first_private_address]}
-        RabbitHost: {"Fn::GetAtt": [notcompute, first_private_address]}
-        NeutronHost: {"Fn::GetAtt": [notcompute, first_private_address]}
-        GlanceHost: {"Fn::GetAtt": [notcompute, first_private_address]}
-        NovaDSN: {"Fn::Join": ['', ['mysql://nova:unset@', {"Fn::GetAtt": [notcompute, first_private_address]}, '/nova']]}
-        NeutronDSN: {"Fn::Join": ['', ['mysql://neutron:unset@', {"Fn::GetAtt": [notcompute, first_private_address]}, '/neutron']]}
+        NovaApiHost: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notcompute, networks]} ]} ] }
+        KeystoneHost: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notcompute, networks]} ]} ] }
+        RabbitHost: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notcompute, networks]} ]} ] }
+        NeutronHost: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notcompute, networks]} ]} ] }
+        GlanceHost: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notcompute, networks]} ]} ] }
+        NovaDSN: {"Fn::Join": ['', ['mysql://nova:unset@', {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notcompute, networks]} ]} ]}, '/nova']]}
+        NeutronDSN: {"Fn::Join": ['', ['mysql://neutron:unset@', {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notcompute, networks]} ]} ]}, '/neutron']]}
         NeutronNetworkType: "gre"
         NeutronEnableTunnelling: "True"
         NeutronNetworkVLANRanges: ""
@@ -133,16 +133,24 @@ Resources:
         service-password:
           Ref: CinderPassword
       controller-address:
-        Fn::GetAtt:
-          - notcompute
-          - first_private_address
+        Fn::Select:
+         - 0
+         - Fn::Select:
+             - 'ctlplane'
+             - Fn::GetAtt:
+               - notcompute
+               - networks
       db-password: unset
       glance:
         db: mysql://glance:unset@localhost/glance
         host:
-          Fn::GetAtt:
-            - notcompute
-            - first_private_address
+          Fn::Select:
+           - 0
+           - Fn::Select:
+               - 'ctlplane'
+               - Fn::GetAtt:
+                 - notcompute
+                 - networks
         service-password:
           Ref: GlancePassword
       os-collect-config:
@@ -167,41 +175,59 @@ Resources:
           Fn::Join:
             - ''
             - - 'http://'
-              - Fn::GetAtt:
+              - Fn::Select:
+                - 'ctlplane'
+                - Fn::GetAtt:
                   - notcompute
-                  - first_private_address
+                  - networks
               - ':8003'
         metadata_server_url:
           Fn::Join:
             - ''
             - - 'http://'
-              - Fn::GetAtt:
-                  - notcompute
-                  - first_private_address
+              - Fn::Select:
+                - 0
+                - Fn::Select:
+                  - 'ctlplane'
+                  - Fn::GetAtt:
+                    - notcompute
+                    - networks
               - ':8000'
         waitcondition_server_url:
           Fn::Join:
             - ''
             - - 'http://'
-              - Fn::GetAtt:
-                  - notcompute
-                  - first_private_address
+              - Fn::Select:
+                - 0
+                - Fn::Select:
+                  - 'ctlplane'
+                  - Fn::GetAtt:
+                    - notcompute
+                    - networks
               - ':8000/v1/waitcondition'
       interfaces:
         control: eth0
       keystone:
         db: mysql://keystone:unset@localhost/keystone
         host:
-          Fn::GetAtt:
-            - notcompute
-            - first_private_address
+          Fn::Select:
+            - 0
+            - Fn::Select:
+              - 'ctlplane'
+              - Fn::GetAtt:
+                - notcompute
+                - networks
       nova:
         compute_driver: libvirt.LibvirtDriver
         db: mysql://nova:unset@localhost/nova
         host:
-          Fn::GetAtt:
-            - notcompute
-            - first_private_address
+          Fn::Select:
+            - 0
+            - Fn::Select:
+              - 'ctlplane'
+              - Fn::GetAtt:
+                - notcompute
+                - networks
         metadata-proxy: true
         service-password:
           Ref: NovaPassword
index 7bcc8f2..8fda08f 100644 (file)
@@ -73,9 +73,13 @@ Resources:
       admin-token: 
         Ref: AdminToken
       controller-address:
-        Fn::GetAtt:
-          - notcompute
-          - first_private_address
+        Fn::Select:
+          - 0
+          - Fn::Select:
+            - "ctlplane"
+            - Fn::GetAtt:
+              - notcompute
+              - networks
       cinder:
         db: mysql://cinder:unset@localhost/cinder
         volume_size_mb: '5000'
@@ -96,19 +100,19 @@ Resources:
           Fn::Join:
             - ''
             - - http://
-              - {"Fn::GetAtt": [ notcompute, first_private_address ]}
+              - {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [ notcompute, networks ]} ]}]}
               - ":8003"
         metadata_server_url:
           Fn::Join:
             - ''
             - - http://
-              - {"Fn::GetAtt": [ notcompute, first_private_address ]}
+              - {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [ notcompute, networks ]} ]}]}
               - ":8000"
         waitcondition_server_url:
           Fn::Join:
             - ''
             - - http://
-              - {"Fn::GetAtt": [ notcompute, first_private_address ]}
+              - {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [ notcompute, networks ]} ]}]}
               - ":8000/v1/waitcondition"
       os-collect-config:
         cfn: