]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
mds: fix --limit run against mds nodes
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 9 Apr 2020 23:02:06 +0000 (01:02 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Tue, 14 Apr 2020 15:51:28 +0000 (11:51 -0400)
This commit fixes --limit runs against mds nodes.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 378405e3285bac412ca0ead90212f456af051574)

roles/ceph-facts/tasks/facts.yml
roles/ceph-mds/tasks/create_mds_filesystems.yml

index 18c0392d933120ed7eddaf91d5bf44ba01e50313..42739d94e7a1db33f63bef837541cdf9686ff91d 100644 (file)
     use_new_ceph_iscsi: "{{ (gateway_ip_list  == '0.0.0.0' and gateway_iqn | length == 0 and client_connections | length == 0 and rbd_devices | length == 0) | bool | ternary(true, false) }}"
   when: iscsi_gw_group_name in group_names
 
+- name: set_fact ceph_run_cmd
+  set_fact:
+    ceph_run_cmd: "{{ container_binary + ' run --rm --net=host -v /etc/ceph:/etc/ceph:z -v /var/lib/ceph/:/var/lib/ceph/:z -v /var/log/ceph/:/var/log/ceph/:z --entrypoint=ceph ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else 'ceph' }}"
+
 - name: set_fact ceph_admin_command
   set_fact:
-    ceph_admin_command: "{{ container_binary + ' run --rm --net=host -v /etc/ceph:/etc/ceph:z -v /var/lib/ceph/:/var/lib/ceph/:z -v /var/log/ceph/:/var/log/ceph/:z --entrypoint=ceph ' + ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment else 'ceph' }} -n client.admin -k /etc/ceph/{{ cluster }}.client.admin.keyring"
\ No newline at end of file
+    ceph_admin_command: "{{ ceph_run_cmd }} -n client.admin -k /etc/ceph/{{ cluster }}.client.admin.keyring"
\ No newline at end of file
index cef59bb5aa4432551488af1e1dd80d836cda50de..c2f5121b8462b5ce5c45a5806ec09b37ce70d103 100644 (file)
@@ -9,7 +9,7 @@
             cephfs_pool_names: "{{ cephfs_pools | map(attribute='name') | list }}"
 
         - name: get and store list of filesystem pools
-          command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool ls"
+          command: "{{ ceph_run_cmd }} --cluster {{ cluster }} osd pool ls"
           changed_when: false
           register: osd_pool_ls
 
@@ -27,7 +27,7 @@
 
         - name: create filesystem pools
           command: >
-            {{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }}
+            {{ ceph_run_cmd }} --cluster {{ cluster }}
             osd pool create {{ item.name }}
             {{ item.pg_num | default(osd_pool_default_pg_num) if not item.pg_autoscale_mode | default(False) | bool else 16 }}
             {{ item.pgp_num | default(item.pg_num) | default(osd_pool_default_pg_num) if not item.pg_autoscale_mode | default(False) | bool else '' }}
             - "{{ cephfs_pools }}"
 
         - name: set the target ratio on pool(s)
-          command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} osd pool set {{ item.name }} target_size_ratio {{ item.target_size_ratio }}"
+          command: "{{ ceph_run_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} target_size_ratio {{ item.target_size_ratio }}"
           with_items: "{{ cephfs_pools | unique }}"
-          delegate_to: "{{ groups[mon_group_name][0] }}"
           when: item.pg_autoscale_mode | default(False) | bool
 
         - name: set pg_autoscale_mode value on pool(s)
-          command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode {{ item.pg_autoscale_mode | default(False) | ternary('on', 'warn') }}"
-          delegate_to: "{{ groups[mon_group_name][0] }}"
+          command: "{{ ceph_run_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode {{ item.pg_autoscale_mode | default(False) | ternary('on', 'warn') }}"
           with_items: "{{ cephfs_pools | unique }}"
 
         - name: customize pool size
-          command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool set {{ item.name }} size {{ item.size | default(osd_pool_default_size) }} {{ '--yes-i-really-mean-it' if item.size | default(osd_pool_default_size) | int == 1 else '' }}"
+          command: "{{ ceph_run_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} size {{ item.size | default(osd_pool_default_size) }} {{ '--yes-i-really-mean-it' if item.size | default(osd_pool_default_size) | int == 1 else '' }}"
           with_items: "{{ cephfs_pools | unique }}"
           changed_when: false
           when:
@@ -64,7 +62,7 @@
             - item.type | default('replicated') != 'erasure'
 
         - name: customize pool min_size
-          command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool set {{ item.name }} min_size {{ item.min_size | default(osd_pool_default_min_size) }}"
+          command: "{{ ceph_run_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} min_size {{ item.min_size | default(osd_pool_default_min_size) }}"
           with_items: "{{ cephfs_pools | unique }}"
           changed_when: false
           when:
@@ -73,7 +71,7 @@
             - item.type | default('replicated') != 'erasure'
 
         - name: assign application to cephfs pools
-          command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool application enable {{ item.name }} {{ item.application }}"
+          command: "{{ ceph_run_cmd }} --cluster {{ cluster }} osd pool application enable {{ item.name }} {{ item.application }}"
           with_items:
             - "{{ cephfs_data_pool }}"
             - "{{ cephfs_metadata_pool }}"
   delegate_to: "{{ groups[mon_group_name][0] }}"
   block:
     - name: check if ceph filesystem already exists
-      command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} fs get {{ cephfs }}"
+      command: "{{ ceph_run_cmd }} --cluster {{ cluster }} fs get {{ cephfs }}"
       register: check_existing_cephfs
       changed_when: false
       failed_when: false
 
     - name: create ceph filesystem
-      command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} fs new {{ cephfs }} {{ cephfs_metadata_pool.name }} {{ cephfs_data_pool.name }}"
+      command: "{{ ceph_run_cmd }} --cluster {{ cluster }} fs new {{ cephfs }} {{ cephfs_metadata_pool.name }} {{ cephfs_data_pool.name }}"
       changed_when: false
       when: check_existing_cephfs.rc != 0
 
 - name: set max_mds
-  command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} fs set {{ cephfs }} max_mds {{ mds_max_mds }}"
+  command: "{{ ceph_run_cmd }} --cluster {{ cluster }} fs set {{ cephfs }} max_mds {{ mds_max_mds }}"
   changed_when: false
   delegate_to: "{{ groups[mon_group_name][0] }}"
   when: