]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
mdss: do not make pg_num a mandatory params
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 29 May 2018 07:18:08 +0000 (09:18 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 30 May 2018 14:20:34 +0000 (16:20 +0200)
When playing ceph-mds role, mon nodes have set a fact with the default
pg num for osd pools, we can simply default to this value for cephfs
pools (`cephfs_pools` variable).

At the moment the variable definition for `cephfs_pools` looks like:

```
cephfs_pools:
  - { name: "{{ cephfs_data }}", pgs: "" }
  - { name: "{{ cephfs_metadata }}", pgs: "" }
```

and we have a task in `ceph-validate` to ensure `pgs` has been set to a
valid value.

We could simply avoid this check by setting the default value of `pgs`
to `hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num']` and
let to users the possibility to override this value.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1581164
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
group_vars/all.yml.sample
group_vars/rhcs.yml.sample
roles/ceph-defaults/defaults/main.yml
roles/ceph-validate/tasks/main.yml
tests/functional/centos/7/cluster/group_vars/all
tests/functional/centos/7/docker-collocation/group_vars/all
tests/functional/centos/7/docker/group_vars/all
tests/functional/ubuntu/16.04/cluster/group_vars/all

index dbaae46a22afbca4a7b44cbfd740fb16eedea282..fbfdedb311cd0ef60b317a1d0cf72bc4d35b44a7 100644 (file)
@@ -352,8 +352,8 @@ dummy:
 #cephfs_metadata: cephfs_metadata # name of the metadata pool for a given filesystem
 
 #cephfs_pools:
-#  - { name: "{{ cephfs_data }}", pgs: "" }
-#  - { name: "{{ cephfs_metadata }}", pgs: "" }
+#  - { name: "{{ cephfs_data }}", pgs: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}" }
+#  - { name: "{{ cephfs_metadata }}", pgs: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}" }
 
 ## OSD options
 #
index cdefcd0ca05d136b4a4458f35f69db1d3d73ed64..0b9a9aeca33b470b36c3aa11c7cde6f040c1723f 100644 (file)
@@ -352,8 +352,8 @@ ceph_repository: rhcs
 #cephfs_metadata: cephfs_metadata # name of the metadata pool for a given filesystem
 
 #cephfs_pools:
-#  - { name: "{{ cephfs_data }}", pgs: "" }
-#  - { name: "{{ cephfs_metadata }}", pgs: "" }
+#  - { name: "{{ cephfs_data }}", pgs: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}" }
+#  - { name: "{{ cephfs_metadata }}", pgs: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}" }
 
 ## OSD options
 #
index 095f578080b427c6090cfd6b733ec61199924526..cb114b62b5b3d73523decd3ad02c34f5cada87f6 100644 (file)
@@ -344,8 +344,8 @@ cephfs_data: cephfs_data # name of the data pool for a given filesystem
 cephfs_metadata: cephfs_metadata # name of the metadata pool for a given filesystem
 
 cephfs_pools:
-  - { name: "{{ cephfs_data }}", pgs: "" }
-  - { name: "{{ cephfs_metadata }}", pgs: "" }
+  - { name: "{{ cephfs_data }}", pgs: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}" }
+  - { name: "{{ cephfs_metadata }}", pgs: "{{ hostvars[groups[mon_group_name][0]]['osd_pool_default_pg_num'] }}" }
 
 ## OSD options
 #
index 1edaba5ef9f6a7965ff4e32b38776313f0c0578d..abac2c7d65f54e7fff7b849f1efb31955ef5d4b1 100644 (file)
     - ceph_rhcs_cdn_debian_repo == 'https://customername:customerpasswd@rhcs.download.redhat.com'
     - ceph_repository not in ['rhcs', 'dev', 'obs']
 
-- name: make sure pg num is set for cephfs pools
-  fail:
-    msg: "You must set pg num for your cephfs pools, see the cephfs_pools variable."
-  with_items: "{{ cephfs_pools }}"
-  when:
-    - groups.get(mds_group_name, []) | length > 0
-    - mon_group_name in group_names
-    - item.pgs == ''
-
 - name: make sure journal_size configured
   debug:
     msg: "WARNING: journal_size is configured to {{ journal_size }}, which is less than 5GB. This is not recommended and can lead to severe issues."
index 4a6128afdc6c887eb18a4e99da65884a08313e70..e33f448afb6d8ce4e7e915c563b44ac9ebaf8c4e 100644 (file)
@@ -39,7 +39,4 @@ openstack_cinder_pool:
   expected_num_objects: ""
 openstack_pools:
   - "{{ openstack_glance_pool }}"
-  - "{{ openstack_cinder_pool }}"
-cephfs_pools:
-- { name: "{{ cephfs_data }}", pgs: "8" }
-- { name: "{{ cephfs_metadata }}", pgs: "8" }
\ No newline at end of file
+  - "{{ openstack_cinder_pool }}"
\ No newline at end of file
index be498905b9e1cfac68e3e76253f0d9cc571a8a7a..99b2e5c1e294c75cf2d7be3b1ebe03591c9da30e 100644 (file)
@@ -21,7 +21,4 @@ ceph_conf_overrides:
     osd_pool_default_size: 1
 devices:
   - /dev/sda
-  - /dev/sdb
-cephfs_pools:
-  - { name: "{{ cephfs_data }}", pgs: "8" }
-  - { name: "{{ cephfs_metadata }}", pgs: "8" }
\ No newline at end of file
+  - /dev/sdb
\ No newline at end of file
index 680f6ce656a7a04ab5bac9d88a0fa3301735147d..9366db4695b87eb216159ebb34ce7d41db9f0716 100644 (file)
@@ -40,7 +40,4 @@ openstack_cinder_pool:
   expected_num_objects: ""
 openstack_pools:
   - "{{ openstack_glance_pool }}"
-  - "{{ openstack_cinder_pool }}"
-cephfs_pools:
-  - { name: "{{ cephfs_data }}", pgs: "8" }
-  - { name: "{{ cephfs_metadata }}", pgs: "8" }
\ No newline at end of file
+  - "{{ openstack_cinder_pool }}"
\ No newline at end of file
index 1a51577bd4b345d008abf886e10764da86150984..4550c1d3e3ae9ab98c25715035bec03252c9f38f 100644 (file)
@@ -27,7 +27,4 @@ nfs_ganesha_stable: true
 nfs_ganesha_stable_branch: V2.5-stable
 nfs_ganesha_stable_deb_repo: "{{ ceph_mirror }}/nfs-ganesha/deb-{{ nfs_ganesha_stable_branch }}/{{ ceph_stable_release }}"
 nfs_ganesha_dev: false
-nfs_ganesha_flavor: "ceph_master"
-cephfs_pools:
-  - { name: "{{ cephfs_data }}", pgs: "8" }
-  - { name: "{{ cephfs_metadata }}", pgs: "8" }
\ No newline at end of file
+nfs_ganesha_flavor: "ceph_master"
\ No newline at end of file