]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
site: collocated mon and mgr by default
authorSébastien Han <seb@redhat.com>
Tue, 16 Oct 2018 13:40:35 +0000 (15:40 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 3 Dec 2018 13:39:43 +0000 (14:39 +0100)
This will speed up the deployment and also deploy mon and mgr collocated
just as recommended.
This won't prevent you of adding more and dedicaded machines for mgr if
needed.

Signed-off-by: Sébastien Han <seb@redhat.com>
25 files changed:
infrastructure-playbooks/rolling_update.yml
roles/ceph-mon/tasks/ceph_keys.yml
roles/ceph-mon/tasks/docker/main.yml
site-container.yml.sample
site.yml.sample
tests/functional/centos/7/add-osds-container/hosts
tests/functional/centos/7/add-osds-container/hosts-2
tests/functional/centos/7/add-osds/hosts
tests/functional/centos/7/add-osds/hosts-2
tests/functional/centos/7/bs-lvm-osds-container/hosts
tests/functional/centos/7/bs-lvm-osds/hosts
tests/functional/centos/7/cluster/hosts
tests/functional/centos/7/cluster/vagrant_variables.yml
tests/functional/centos/7/docker-collocation/hosts
tests/functional/centos/7/docker/hosts
tests/functional/centos/7/docker/vagrant_variables.yml
tests/functional/centos/7/lvm-batch-container/hosts
tests/functional/centos/7/lvm-batch/hosts
tests/functional/centos/7/lvm-osds-container/hosts
tests/functional/centos/7/lvm-osds/hosts
tests/functional/centos/7/rgw-multisite-container/secondary/hosts
tests/functional/centos/7/rgw-multisite/hosts
tests/functional/centos/7/shrink_osd/hosts
tests/functional/centos/7/shrink_osd_container/hosts
tests/functional/fedora/29/container-podman/hosts

index 526d2cadc99fc037fcf5a38ec7c6d47be90cb7e0..eb0753bedd4b5c32e38579e792e4b44c5fe0cf9b 100644 (file)
       when:
         - not containerized_deployment
 
+    - name: stop ceph mgr
+      systemd:
+        name: ceph-mgr@{{ ansible_hostname }}
+        state: stopped
+        enabled: yes
+      ignore_errors: True # if no mgr collocated with mons
+      when:
+        - not containerized_deployment
+
     - import_role:
         name: ceph-defaults
         private: false
     - import_role:
         name: ceph-mon
         private: false
+    - import_role:
+        name: ceph-mgr
+        private: false
+      when: groups.get(mgr_group_name, []) | length == 0
 
     - name: start ceph mon
       systemd:
       when:
         - not containerized_deployment
 
+    - name: start ceph mgr
+      systemd:
+        name: ceph-mgr@{{ ansible_hostname }}
+        state: started
+        enabled: yes
+      ignore_errors: True # if no mgr collocated with mons
+      when:
+        - not containerized_deployment
+
     - name: restart containerized ceph mon
       systemd:
         name: ceph-mon@{{ monitor_name }}
       when:
         - containerized_deployment
 
+    - name: restart containerized ceph mgr
+      systemd:
+        name: ceph-mgr@{{ monitor_name }}
+        state: restarted
+        enabled: yes
+        daemon_reload: yes
+      ignore_errors: True # if no mgr collocated with mons
+      when:
+        - containerized_deployment
+
     - name: set mon_host_count
       set_fact: mon_host_count={{ groups[mon_group_name] | length }}
 
index 24c5548c09c1107bfd251491207c316c9275c5e5..aa6445252b78fd76443db506d94efad853c4b69d 100644 (file)
     secret: "{{ (mgr_secret != 'mgr_secret') | ternary(mgr_secret, omit) }}"
   when:
     - cephx
-    - groups.get(mgr_group_name, []) | length > 0
     - inventory_hostname == groups[mon_group_name]|last
-  with_items: "{{ groups.get(mgr_group_name, []) }}"
+  with_items:
+    - "{{ groups.get(mgr_group_name, []) }}" # this honors the condition where mgrs run on separate machines
+    - "{{ groups.get(mon_group_name, []) }}" # this honors the new rule where mgrs are always collocated with mons
 
 # once this gets backported github.com/ceph/ceph/pull/20983
 # we will be able to remove these 2 tasks below
index 28092966f6fd35213382e5240e7d71408b711112..fc973645a6520f5aa03c26ac9c4c4d3a305b23e9 100644 (file)
@@ -34,8 +34,9 @@
     when:
       - cephx
       - containerized_deployment
-      - groups.get(mgr_group_name, []) | length > 0
-    with_items: "{{ groups.get(mgr_group_name, []) }}"
+    with_items:
+        - "{{ groups.get(mgr_group_name, []) }}" # this honors the condition where mgrs run on separate machines
+        - "{{ groups.get(mon_group_name, []) }}" # this honors the new rule where mgrs are always collocated with mons
 
   - name: fetch ceph mgr key(s)
     fetch:
index e50db511c16f3133a5c55284f32e8f277d6d1392..898530e8421d2d8fa021906b664f09fe1c57cd11 100644 (file)
     - import_role:
         name: ceph-mon
         private: false
+    - import_role:
+        name: ceph-mgr
+        private: false
+
   serial: 1 # MUST be '1' WHEN DEPLOYING MONITORS ON DOCKER CONTAINERS
 
 - hosts: mons
index 09f9daf4417bd9961c8b9932aec555b1dbc026fe..0ea698ded27731f54c5b6aa69ca9b6e1dce48c27 100644 (file)
     - import_role:
         name: ceph-mon
         private: false
+    - import_role:
+        name: ceph-mgr
+        private: false
 
     # post-tasks for preceding imports -
     - name: set ceph monitor install 'Complete'
index d6c89012a9db9c79663024d925b78041bbab1a99..f6a265ab3e5d6093f9a7ed71fefc9358d8d0a8a3 100644 (file)
@@ -1,8 +1,5 @@
 [mons]
 mon0
 
-[mgrs]
-mon0
-
 [osds]
 osd0
index 288617eda31e69f52482c94385fd92ddb5fddb3e..073437d683170c73d5127ab435ee718ea29a53bf 100644 (file)
@@ -1,9 +1,6 @@
 [mons]
 mon0
 
-[mgrs]
-mon0
-
 [osds]
 osd0
 osd1
index d6c89012a9db9c79663024d925b78041bbab1a99..f6a265ab3e5d6093f9a7ed71fefc9358d8d0a8a3 100644 (file)
@@ -1,8 +1,5 @@
 [mons]
 mon0
 
-[mgrs]
-mon0
-
 [osds]
 osd0
index 288617eda31e69f52482c94385fd92ddb5fddb3e..073437d683170c73d5127ab435ee718ea29a53bf 100644 (file)
@@ -1,9 +1,6 @@
 [mons]
 mon0
 
-[mgrs]
-mon0
-
 [osds]
 osd0
 osd1
index d6c89012a9db9c79663024d925b78041bbab1a99..f6a265ab3e5d6093f9a7ed71fefc9358d8d0a8a3 100644 (file)
@@ -1,8 +1,5 @@
 [mons]
 mon0
 
-[mgrs]
-mon0
-
 [osds]
 osd0
index d6c89012a9db9c79663024d925b78041bbab1a99..f6a265ab3e5d6093f9a7ed71fefc9358d8d0a8a3 100644 (file)
@@ -1,8 +1,5 @@
 [mons]
 mon0
 
-[mgrs]
-mon0
-
 [osds]
 osd0
index f5c517794bcdb401f17c2a3668420b7e9a8810ba..e22cf7420ece22bbcaa4d416d78ce85d1d8446ef 100644 (file)
@@ -3,9 +3,6 @@ ceph-mon0 monitor_address=192.168.1.10
 ceph-mon1 monitor_interface=eth1
 ceph-mon2 monitor_address=192.168.1.12
 
-[mgrs]
-ceph-mgr0
-
 [osds]
 ceph-osd0 osd_crush_location="{ 'root': 'HDD', 'rack': 'mon-rackkkk', 'pod': 'monpod', 'host': 'ceph-osd0' }"
 ceph-osd1 osd_crush_location="{ 'root': 'default', 'host': 'ceph-osd1' }"
index c7f468d1d77121829099b6311d90c0a258f37a51..d73d4cfb8c815d2e81e564561a08ae3a5ecdd3af 100644 (file)
@@ -12,7 +12,7 @@ nfs_vms: 0
 rbd_mirror_vms: 1
 client_vms: 2
 iscsi_gw_vms: 1
-mgr_vms: 1
+mgr_vms: 0
 
 # INSTALL SOURCE OF CEPH
 # valid values are 'stable' and 'dev'
index 2ecd002537786cd94abdc0d4ee8794490ac96d2d..7a958f129b8a2bdb37c29fe4edaf712bfc88af12 100644 (file)
@@ -14,10 +14,6 @@ rgw0
 rgw0
 mds0
 
-[mgrs]
-mon0
-osd0
-
 [rbdmirrors]
 rgw0
 mds0
index 3421926b5a2a929ba372edd85b823fcaef487d8a..2623af53a05e79754735428f22422eec291b89ac 100644 (file)
@@ -3,9 +3,6 @@ mon0
 mon1
 mon2
 
-[mgrs]
-mgr0
-
 [osds]
 osd0 osd_crush_location="{ 'root': 'HDD', 'rack': 'mon-rackkkk', 'pod': 'monpod', 'host': 'osd0' }"
 osd1 osd_crush_location="{ 'root': 'default', 'host': 'osd1' }"
index 84678924589cff6a1230b4899dc11eea18cf1d60..07dab29041191e60c20dc338208803783f493b52 100644 (file)
@@ -12,7 +12,7 @@ nfs_vms: 1
 rbd_mirror_vms: 1
 client_vms: 2
 iscsi_gw_vms: 1
-mgr_vms: 1
+mgr_vms: 0
 
 # SUBNETS TO USE FOR THE VMS
 public_subnet: 192.168.17
index d6c89012a9db9c79663024d925b78041bbab1a99..f6a265ab3e5d6093f9a7ed71fefc9358d8d0a8a3 100644 (file)
@@ -1,8 +1,5 @@
 [mons]
 mon0
 
-[mgrs]
-mon0
-
 [osds]
 osd0
index d6c89012a9db9c79663024d925b78041bbab1a99..f6a265ab3e5d6093f9a7ed71fefc9358d8d0a8a3 100644 (file)
@@ -1,8 +1,5 @@
 [mons]
 mon0
 
-[mgrs]
-mon0
-
 [osds]
 osd0
index d6c89012a9db9c79663024d925b78041bbab1a99..f6a265ab3e5d6093f9a7ed71fefc9358d8d0a8a3 100644 (file)
@@ -1,8 +1,5 @@
 [mons]
 mon0
 
-[mgrs]
-mon0
-
 [osds]
 osd0
index d6c89012a9db9c79663024d925b78041bbab1a99..f6a265ab3e5d6093f9a7ed71fefc9358d8d0a8a3 100644 (file)
@@ -1,8 +1,5 @@
 [mons]
 mon0
 
-[mgrs]
-mon0
-
 [osds]
 osd0
index c5e55ff4c7fb113ed9a0630acd2ba7b9005ad1a2..e2e0c30e4846488b4dad8f89ba89cc80e41b043b 100644 (file)
@@ -1,9 +1,6 @@
 [mons]
 mon0
 
-[mgrs]
-mon0
-
 [osds]
 osd0
 
index eb9011efc17bd26376f12343db5c350212839239..2450624898e1c3a1e9a2c74c8447a95e7c9e5410 100644 (file)
@@ -1,9 +1,6 @@
 [mons]
 mon0
 
-[mgrs]
-mon0
-
 [osds]
 osd0
 
index d3b2c1f819fc9cbb828038ed515b3148ceb4891c..13fd8d478989c6a949a2771d9756a3044123c32c 100644 (file)
@@ -1,9 +1,6 @@
 [mons]
 ceph-mon0 monitor_address=192.168.71.10
 
-[mgrs]
-ceph-mon0
-
 [osds]
 ceph-osd0
 ceph-osd1
index 6c1829b31effcd66aba3149bc5297007fb9de352..458c66a844eebf703e5c2850da140f105c6c266c 100644 (file)
@@ -1,9 +1,6 @@
 [mons]
 mon0
 
-[mgrs]
-mon0
-
 [osds]
 osd0
 osd1
index ed6bf602c0ce8e9ef5603d3091d37b9e07eec6b3..d45a218c3873f92c859dfe3c03d163d90f3cee74 100644 (file)
@@ -3,9 +3,6 @@ mon0
 mon1
 mon2
 
-[mgrs]
-mgr0
-
 [osds]
 osd0 osd_crush_location="{ 'root': 'HDD', 'rack': 'mon-rackkkk', 'pod': 'monpod', 'host': 'osd0' }"
 osd1 osd_crush_location="{ 'root': 'default', 'host': 'osd1' }"