Merge "Add rabbit.cookie attribute"
authorJenkins <jenkins@review.openstack.org>
Tue, 11 Mar 2014 05:51:41 +0000 (05:51 +0000)
committerGerrit Code Review <review@openstack.org>
Tue, 11 Mar 2014 05:51:41 +0000 (05:51 +0000)
.gitignore
Makefile
block-storage-nfs.yaml [new file with mode: 0644]
block-storage.yaml
examples/scale_map_result.yaml
nfs-server-source.yaml [new file with mode: 0644]
notcompute.yaml
nova-compute-instance.yaml
overcloud-source.yaml
tripleo_heat_merge/merge.py
undercloud-source.yaml

index 90c6090..06513ac 100644 (file)
@@ -1,5 +1,7 @@
 # Built via Makefile
 overcloud.yaml
+overcloud-with-block-storage.yaml
+overcloud-with-block-storage-nfs.yaml
 undercloud-bm.yaml
 undercloud-vm.yaml
 undercloud-vm-tuskar.yaml
index dda8f2c..93ff852 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,10 @@
-generated_templates =                \
-        overcloud.yaml               \
-        undercloud-vm.yaml           \
-        undercloud-bm.yaml           \
-        undercloud-vm-tuskar.yaml    \
+generated_templates =                         \
+        overcloud.yaml                        \
+        overcloud-with-block-storage.yaml     \
+        overcloud-with-block-storage-nfs.yaml \
+        undercloud-vm.yaml                    \
+        undercloud-bm.yaml                    \
+        undercloud-vm-tuskar.yaml             \
         undercloud-vm-ironic.yaml
 
 # Files included in overcloud-source.yaml via FileInclude
@@ -17,7 +19,13 @@ overcloud.yaml: overcloud-source.yaml swift-source.yaml ssl-source.yaml $(overcl
 overcloud-with-block-storage.yaml: overcloud-source.yaml nova-compute-instance.yaml swift-source.yaml block-storage.yaml
        # $^ won't work here because we want to list nova-compute-instance.yaml as
        # a prerequisite but don't want to pass it into merge.py
-       python ./tripleo_heat_merge/merge.py overcloud-source.yaml swift-source.yaml block-storage.yaml > $@.tmp
+       python ./tripleo_heat_merge/merge.py --scale NovaCompute=$${COMPUTESCALE:-'1'} --scale BlockStorage=$${CINDERSCALE:-'1'} overcloud-source.yaml swift-source.yaml block-storage.yaml > $@.tmp
+       mv $@.tmp $@
+
+overcloud-with-block-storage-nfs.yaml: overcloud-source.yaml nova-compute-instance.yaml swift-source.yaml nfs-server-source.yaml block-storage-nfs.yaml
+       # $^ won't work here because we want to list nova-compute-instance.yaml as
+       # a prerequisite but don't want to pass it into merge.py
+       python ./tripleo_heat_merge/merge.py --scale NovaCompute=$${COMPUTESCALE:-'1'} --scale BlockStorage=$${CINDERSCALE:-'1'} overcloud-source.yaml swift-source.yaml nfs-server-source.yaml block-storage-nfs.yaml > $@.tmp
        mv $@.tmp $@
 
 undercloud-vm.yaml: undercloud-source.yaml undercloud-vm-source.yaml
@@ -36,10 +44,12 @@ undercloud-vm-ironic.yaml: undercloud-source.yaml undercloud-vm-ironic-source.ya
        python ./tripleo_heat_merge/merge.py $^ > $@.tmp
        mv $@.tmp $@
 
+check: test
+
 test:
        @bash test_merge.bash
 
 clean:
        rm -f $(generated_templates)
 
-.PHONY: clean overcloud.yaml
+.PHONY: clean overcloud.yaml check
diff --git a/block-storage-nfs.yaml b/block-storage-nfs.yaml
new file mode 100644 (file)
index 0000000..04f45ef
--- /dev/null
@@ -0,0 +1,59 @@
+HeatTemplateFormatVersion: '2012-12-12'
+Description: 'Common Block Storage Configuration'
+Parameters:
+  BlockStorageImage:
+    Type: String
+    Default: overcloud-cinder-volume
+  OvercloudBlockStorageFlavor:
+    Default: baremetal
+    Description: Flavor for block storage nodes to request when deploying.
+    Type: String
+Resources:
+  BlockStorageAccessPolicy:
+    Type: OS::Heat::AccessPolicy
+    Properties:
+      AllowedResources:
+      - BlockStorage0
+  BlockStorageUser:
+    Type: AWS::IAM::User
+    Properties:
+      Policies: [ { Ref: BlockStorageAccessPolicy } ]
+  BlockStorageKey:
+    Type: AWS::IAM::AccessKey
+    Properties:
+      UserName:
+        Ref: BlockStorageUser
+  BlockStorage0:
+    Type: OS::Nova::Server
+    Properties:
+      image:
+        {Ref: BlockStorageImage}
+      flavor: {Ref: OvercloudBlockStorageFlavor}
+      key_name: {Ref: KeyName}
+    Metadata:
+      os-collect-config:
+        cfn:
+          access_key_id:
+            Ref: BlockStorageKey
+          secret_access_key:
+            Fn::GetAtt: [ BlockStorageKey, SecretAccessKey ]
+          stack_name: {Ref: 'AWS::StackName'}
+      OpenStack::ImageBuilder::Elements: [ cinder ]
+      keystone:
+        host: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ] }
+      cinder:
+        db: {"Fn::Join": ['', ['mysql://cinder:unset@', {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ] } , '/cinder']]}
+        volume_size_mb: '5000'
+        service-password:
+          Ref: CinderPassword
+        volume: 'true'
+        include_nfs_backend: 'true'
+        nfs_shares:
+          - {"Fn::Join": ['', [{"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ] } , ':/mnt/state/var/lib/nfs_share']]}
+      admin-password: {Ref: AdminPassword}
+      rabbit:
+        host: {"Fn::Select": [ 0, {"Fn::Select": [ "ctlplane", {"Fn::GetAtt": [notCompute0, networks]} ]} ] }
+        username: {Ref: RabbitUserName}
+        password: {Ref: RabbitPassword}
+      interfaces:
+        control: {Ref: NeutronPublicInterface}
index ca56fce..c801040 100644 (file)
@@ -11,6 +11,10 @@ Parameters:
     Type: String
     Default: "guest"
     NoEcho: true
+  OvercloudBlockStorageFlavor:
+    Default: baremetal
+    Description: Flavor for block storage nodes to request when deploying.
+    Type: String
 Resources:
   BlockStorageAccessPolicy:
     Type: OS::Heat::AccessPolicy
@@ -31,7 +35,7 @@ Resources:
     Properties:
       image:
         {Ref: BlockStorageImage}
-      flavor: {Ref: Flavor}
+      flavor: {Ref: OvercloudBlockStorageFlavor}
       key_name: {Ref: KeyName}
     Metadata:
       os-collect-config:
index 5fa0229..c461783 100644 (file)
@@ -66,6 +66,50 @@ Resources:
                       - NovaCompute0
                       - show
                   - local
+          - Fn::Join:
+            - ' '
+            - - Fn::Select:
+                - 0
+                - Fn::Select:
+                  - ctlplane
+                  - Fn::GetAtt:
+                    - NovaCompute1
+                    - networks
+              - Fn::Select:
+                - name
+                - Fn::GetAtt:
+                  - NovaCompute1
+                  - show
+              - Fn::Join:
+                - .
+                - - Fn::Select:
+                    - name
+                    - Fn::GetAtt:
+                      - NovaCompute1
+                      - show
+                  - local
+          - Fn::Join:
+            - ' '
+            - - Fn::Select:
+                - 0
+                - Fn::Select:
+                  - ctlplane
+                  - Fn::GetAtt:
+                    - NovaCompute2
+                    - networks
+              - Fn::Select:
+                - name
+                - Fn::GetAtt:
+                  - NovaCompute2
+                  - show
+              - Fn::Join:
+                - .
+                - - Fn::Select:
+                    - name
+                    - Fn::GetAtt:
+                      - NovaCompute2
+                      - show
+                  - local
       os-collect-config:
         cfn:
           access_key_id:
@@ -120,6 +164,28 @@ Resources:
 
           '
         - - Fn::Join:
+            - ' '
+            - - Fn::Select:
+                - 0
+                - Fn::Select:
+                  - ctlplane
+                  - Fn::GetAtt:
+                    - NovaCompute0
+                    - networks
+              - Fn::Select:
+                - name
+                - Fn::GetAtt:
+                  - NovaCompute0
+                  - show
+              - Fn::Join:
+                - .
+                - - Fn::Select:
+                    - name
+                    - Fn::GetAtt:
+                      - NovaCompute0
+                      - show
+                  - local
+          - Fn::Join:
             - ' '
             - - Fn::Select:
                 - 0
@@ -141,6 +207,28 @@ Resources:
                       - NovaCompute1
                       - show
                   - local
+          - Fn::Join:
+            - ' '
+            - - Fn::Select:
+                - 0
+                - Fn::Select:
+                  - ctlplane
+                  - Fn::GetAtt:
+                    - NovaCompute2
+                    - networks
+              - Fn::Select:
+                - name
+                - Fn::GetAtt:
+                  - NovaCompute2
+                  - show
+              - Fn::Join:
+                - .
+                - - Fn::Select:
+                    - name
+                    - Fn::GetAtt:
+                      - NovaCompute2
+                      - show
+                  - local
       os-collect-config:
         cfn:
           access_key_id:
@@ -195,6 +283,50 @@ Resources:
 
           '
         - - Fn::Join:
+            - ' '
+            - - Fn::Select:
+                - 0
+                - Fn::Select:
+                  - ctlplane
+                  - Fn::GetAtt:
+                    - NovaCompute0
+                    - networks
+              - Fn::Select:
+                - name
+                - Fn::GetAtt:
+                  - NovaCompute0
+                  - show
+              - Fn::Join:
+                - .
+                - - Fn::Select:
+                    - name
+                    - Fn::GetAtt:
+                      - NovaCompute0
+                      - show
+                  - local
+          - Fn::Join:
+            - ' '
+            - - Fn::Select:
+                - 0
+                - Fn::Select:
+                  - ctlplane
+                  - Fn::GetAtt:
+                    - NovaCompute1
+                    - networks
+              - Fn::Select:
+                - name
+                - Fn::GetAtt:
+                  - NovaCompute1
+                  - show
+              - Fn::Join:
+                - .
+                - - Fn::Select:
+                    - name
+                    - Fn::GetAtt:
+                      - NovaCompute1
+                      - show
+                  - local
+          - Fn::Join:
             - ' '
             - - Fn::Select:
                 - 0
diff --git a/nfs-server-source.yaml b/nfs-server-source.yaml
new file mode 100644 (file)
index 0000000..22214ae
--- /dev/null
@@ -0,0 +1,28 @@
+Description: 'NFS server share configuration for testing'
+Resources:
+  notCompute0Config:
+    Type: AWS::AutoScaling::LaunchConfiguration
+    Metadata:
+      nfs_server:
+        shares:
+          Merge::Map:
+            NovaCompute0:
+              Fn::Join:
+              - ' '
+              - - Fn::Select:
+                  - 0
+                  - Fn::Select:
+                    - ctlplane
+                    - Fn::GetAtt:
+                      - NovaCompute0
+                      - networks
+            BlockStorage0:
+              Fn::Join:
+              - ' '
+              - - Fn::Select:
+                  - 0
+                  - Fn::Select:
+                    - ctlplane
+                    - Fn::GetAtt:
+                      - BlockStorage0
+                      - networks
\ No newline at end of file
index 2d3301f..2ad5b30 100644 (file)
@@ -31,6 +31,14 @@ Parameters:
     Description: Password for connecting to glance database
     Type: String
     NoEcho: true
+  GlanceNotifierStrategy:
+    Description: Strategy to use for Glance notification queue
+    Type: String
+    Default: noop
+  GlanceLogFile:
+    Description: The filepath of the file to use for logging messages from Glance.
+    Type: String
+    Default: ''
   HeatDBPassword:
     Description: Password for accessing Heat database.
     Type: String
@@ -130,6 +138,10 @@ Resources:
             - - 'mysql://glance:'
               - {Ref: GlanceDBPassword}
               - '@127.0.0.1/glance'
+          notifier-strategy:
+            Ref: GlanceNotifierStrategy
+          log-file:
+            Ref: GlanceLogFile
       heat:
         db:
           Fn::Join:
index 55665dc..d2ca90f 100644 (file)
@@ -10,7 +10,7 @@ Parameters:
     Description: Name of an existing EC2 KeyPair to enable SSH access to the instances
     Type: String
     Default: default
-  Flavor:
+  OvercloudComputeFlavor:
     Description: Use this flavor
     Type: String
     Default: baremetal
@@ -108,7 +108,7 @@ Resources:
         Ref: ComputeUser
   NovaCompute0CompletionCondition:
     Type: AWS::CloudFormation::WaitCondition
-    DependsOn: notCompute0
+    DependsOn: notCompute0Config
     Properties:
       Handle: {Ref: NovaCompute0CompletionHandle}
       Count: '1'
@@ -122,7 +122,7 @@ Resources:
         {Ref: NovaImage}
       image_update_policy:
         Ref: ImageUpdatePolicy
-      flavor: {Ref: Flavor}
+      flavor: {Ref: OvercloudComputeFlavor}
       key_name: {Ref: KeyName}
     Metadata:
       os-collect-config:
index fa626aa..42fc07a 100644 (file)
@@ -17,15 +17,27 @@ Parameters:
     Description: The password for the cinder service account, used by cinder-api.
     Type: String
     NoEcho: true
-  Flavor:
+  OvercloudControlFlavor:
     Default: baremetal
-    Description: Flavor to request when deploying.
+    Description: Flavor for control nodes to request when deploying.
+    Type: String
+  OvercloudComputeFlavor:
+    Default: baremetal
+    Description: Flavor for compute nodes to request when deploying.
     Type: String
   GlancePassword:
     Default: unset
     Description: The password for the glance service account, used by the glance services.
     Type: String
     NoEcho: true
+  GlanceNotifierStrategy:
+    Description: Strategy to use for Glance notification queue
+    Type: String
+    Default: noop
+  GlanceLogFile:
+    Description: The filepath of the file to use for logging messages from Glance.
+    Type: String
+    Default: ''
   HeatPassword:
     Default: unset
     Description: The password for the Heat service account, used by the Heat services.
@@ -154,7 +166,7 @@ Resources:
     Type: AWS::IAM::AccessKey
   notCompute0CompletionCondition:
     Type: AWS::CloudFormation::WaitCondition
-    DependsOn: notCompute0
+    DependsOn: notCompute0Config
     Properties:
       Handle: {Ref: notCompute0CompletionHandle}
       Count: '1'
@@ -303,6 +315,10 @@ Resources:
         swift-store-user: service:glance
         swift-store-key:
           Ref: GlancePassword
+        notifier-strategy:
+          Ref: GlanceNotifierStrategy
+        log-file:
+          Ref: GlanceLogFile
       heat:
         admin_password:
           Ref: HeatPassword
@@ -460,7 +476,7 @@ Resources:
       image_update_policy:
         Ref: ImageUpdatePolicy
       flavor:
-        Ref: Flavor
+        Ref: OvercloudControlFlavor
       key_name:
         Ref: KeyName
     Metadata:
index 0de27e2..4571d28 100644 (file)
@@ -33,9 +33,12 @@ def apply_scaling(template, scaling, in_copies=None):
 
     Values are handled via scale_value.
 
-    Keys in dicts are always copied per the scaling rule.
+    Keys in dicts are copied per the scaling rule.
     Values are either replaced or copied depending on whether the given
     scaling rule is in in_copies.
+
+    in_copies is reset to None when a dict {'Merge::Map': someobject} is
+    encountered.
     """
     in_copies = dict(in_copies or {})
     # Shouldn't be needed but to avoid unexpected side effects/bugs we short
@@ -43,6 +46,8 @@ def apply_scaling(template, scaling, in_copies=None):
     if not scaling:
         return template
     if isinstance(template, dict):
+        if 'Merge::Map' in template:
+            in_copies = None
         new_template = {}
         for key, value in template.items():
             for prefix, copy_num, new_key in scale_value(
index 97a05ed..4fe2976 100644 (file)
@@ -24,6 +24,14 @@ Parameters:
     Description: The password for the glance service account, used by the glance services.
     Type: String
     NoEcho: true
+  GlanceNotifierStrategy:
+    Description: Strategy to use for Glance notification queue
+    Type: String
+    Default: noop
+  GlanceLogFile:
+    Description: The filepath of the file to use for logging messages from Glance.
+    Type: String
+    Default: ''
   KeyName:
     Default: default
     Description: Name of an existing EC2 KeyPair to enable SSH access to the instances
@@ -123,6 +131,10 @@ Resources:
         host: 127.0.0.1
         service-password:
           Ref: GlancePassword
+        notifier-strategy:
+          Ref: GlanceNotifierStrategy
+        log-file:
+          Ref: GlanceLogFile
       heat:
         admin_password:
           Ref: HeatPassword