]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
osd: support scaling up using --limit
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 9 Jul 2019 13:40:47 +0000 (15:40 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Tue, 14 Jan 2020 14:12:34 +0000 (09:12 -0500)
This commit lets add-osd.yml in place but mark the deprecation of the
playbook.
Scaling up OSDs is now possible using --limit

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

infrastructure-playbooks/add-osd.yml
roles/ceph-handler/tasks/handler_osds.yml
roles/ceph-osd/tasks/main.yml

index 19aa6fc1561dc0f1e8acbe2854a4c62de1d31ac2..d21c5c02186079ce5f65055d1ea768d84c04c715 100644 (file)
       delegate_to: "{{ groups['mons'][0] }}"
       run_once: True
       changed_when: False
+
+    - name: warn user about deprecation
+      debug:
+        msg: |
+          Playbook has complete.
+          However, note that it will be deprecated in a future release.
+          You can achieve the same goal using the main playbook with --limit
\ No newline at end of file
index 17354a2c254c577a436e13f9513a2b72e8e7f66e..390b84b2ceb1b0b272769b7a16344a49982bdc37 100644 (file)
@@ -3,6 +3,11 @@
   set_fact:
     _osd_handler_called: True
 
+- name: unset noup flag
+  command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd unset noup"
+  delegate_to: "{{ groups[mon_group_name][0] }}"
+  changed_when: False
+
 # This does not just restart OSDs but everything else too. Unfortunately
 # at this time the ansible role does not have an OSD id list to use
 # for restarting them specifically.
index a3038fcc6aab20aa6e9046b31957411642dac571..81975049a1759078c8d27ed451ce8f2de626181d 100644 (file)
@@ -1,4 +1,8 @@
 ---
+- name: set_fact add_osd
+  set_fact:
+    add_osd: "{{ groups[osd_group_name] | length != ansible_play_hosts_all | length }}"
+
 - name: include_tasks system_tuning.yml
   include_tasks: system_tuning.yml
 
 - name: include_tasks common.yml
   include_tasks: common.yml
 
+- name: set noup flag
+  command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd set noup"
+  delegate_to: "{{ groups[mon_group_name][0] }}"
+  run_once: True
+  changed_when: False
+  when: not rolling_update | default(False) | bool
+
 - name: include container_options_facts.yml
   include_tasks: container_options_facts.yml
 
@@ -72,7 +83,7 @@
     openstack_keys_tmp: "{{ openstack_keys_tmp|default([]) + [ { 'key': item.key, 'name': item.name, 'caps': { 'mon': item.mon_cap, 'osd': item.osd_cap|default(''), 'mds': item.mds_cap|default(''), 'mgr': item.mgr_cap|default('') } , 'mode': item.mode } ] }}"
   with_items: "{{ openstack_keys }}"
   when:
-    - not add_osd|default(False) | bool
+    - not add_osd | bool
     - openstack_config | bool
     - item.get('mon_cap', None)
     # it's enough to assume we are running an old-fashionned syntax simply by checking the presence of mon_cap since every key needs this cap
   set_fact:
     openstack_keys: "{{ openstack_keys_tmp }}"
   when:
-    - not add_osd|default(False) | bool
+    - not add_osd | bool
     - openstack_keys_tmp is defined
 
+- name: unset noup flag
+  command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd unset noup"
+  delegate_to: "{{ groups[mon_group_name][0] }}"
+  changed_when: False
+  when:
+    - not rolling_update | default(False) | bool
+    - inventory_hostname == ansible_play_hosts_all | last
+
 # Create the pools listed in openstack_pools
 - name: include openstack_config.yml
   include_tasks: openstack_config.yml
   when:
-    - not add_osd|default(False) | bool
+    - not add_osd | bool
     - openstack_config | bool
     - inventory_hostname == groups[osd_group_name] | last