Update CephPools format in the docker templates to fit ceph-ansible
authorGiulio Fidente <gfidente@redhat.com>
Mon, 2 Oct 2017 12:10:53 +0000 (14:10 +0200)
committerGiulio Fidente <gfidente@redhat.com>
Mon, 30 Oct 2017 08:59:42 +0000 (09:59 +0100)
The format which ceph-ansible uses to describe the list of pools
to be created in the cluster is different from the one which
puppet-ceph uses; this commit updates the description and the
the docker templates accordingly.

Change-Id: I1e5b2c3cbf6ae02c19a2275ca119fed6e173319d
Closes-Bug: #1720373
(cherry picked from commit c10aa7a0439fb7d8e8e964e75d73f3cbb54aa9ec)

docker/services/ceph-ansible/ceph-base.yaml
releasenotes/notes/ceph-pools-with-ceph-ansible-f82425e585f90ef6.yaml [new file with mode: 0644]
tools/yaml-validate.py

index 8cc81fb..4674ec1 100644 (file)
@@ -73,15 +73,9 @@ parameters:
     description: >
       It can be used to override settings for one of the predefined pools, or to create
       additional ones. Example:
-      {
-        "volumes": {
-          "size": 5,
-          "pg_num": 128,
-          "pgp_num": 128
-         }
-      }
-    default: {}
-    type: json
+      [{"name": "volumes", "pg_num": 64, "rule_name": ""}]
+    default: []
+    type: comma_delimited_list
   CinderRbdPoolName:
     default: volumes
     type: string
@@ -225,13 +219,7 @@ outputs:
                       - {get_param: NovaRbdPoolName}
                       - {get_param: GlanceRbdPoolName}
                       - {get_param: GnocchiRbdPoolName}
-              - repeat:
-                  template:
-                    name: <%pool%>
-                    pg_num: {get_param: CephPoolDefaultPgNum}
-                    rule_name: ""
-                  for_each:
-                    <%pool%>: {get_param: CephPools}
+              - {get_param: CephPools}
           openstack_keys: &openstack_keys
           - name:
               list_join:
diff --git a/releasenotes/notes/ceph-pools-with-ceph-ansible-f82425e585f90ef6.yaml b/releasenotes/notes/ceph-pools-with-ceph-ansible-f82425e585f90ef6.yaml
new file mode 100644 (file)
index 0000000..63e6f21
--- /dev/null
@@ -0,0 +1,17 @@
+---
+upgrade:
+  - |
+    The format to use for the CephPools parameter needs to be updated into the
+    form expected by ceph-ansible. For example, for a new pool named `mypool`
+    it should change from:
+    { "mypool": { "size": 3, "pg_num": 128, "pgp_num": 128 } }
+    into:
+    [ { "name": "mypool", "pg_num": 128, "rule_name": "" } ]
+    The first is a map where each key is a pool name and its value the pool
+    properties, the second is a list where each item describes all properties
+    of a pool, including its name.
+other:
+  - |
+    With the migration from puppet-ceph to ceph-ansible for the deployment
+    of Ceph, the format of CephPools parameter changes because the two tools
+    use a different format to represent the list of additional pools to create.
index c322962..76f856d 100755 (executable)
@@ -46,7 +46,10 @@ OPTIONAL_DOCKER_PUPPET_CONFIG_SECTIONS = [ 'puppet_tags', 'volumes' ]
 # consistency across files on.  This should only contain parameters whose
 # definition we cannot change for backwards compatibility reasons.  New
 # parameters to the templates should not be added to this list.
-PARAMETER_DEFINITION_EXCLUSIONS = {'ManagementNetCidr': ['default'],
+PARAMETER_DEFINITION_EXCLUSIONS = {'CephPools': ['description',
+                                                 'type',
+                                                 'default'],
+                                   'ManagementNetCidr': ['default'],
                                    'ManagementAllocationPools': ['default'],
                                    'ExternalNetCidr': ['default'],
                                    'ExternalAllocationPools': ['default'],