]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Implement installer.0 role. 1140/head
authorWarren Usui <wusui@redhat.com>
Fri, 15 Dec 2017 07:59:56 +0000 (07:59 +0000)
committerWarren Usui <wusui@redhat.com>
Fri, 15 Dec 2017 07:59:56 +0000 (07:59 +0000)
This allows one to place the ceph ansible installer node on another machine.
It defaults back to the lowest monitor if there is no installer.0 role.

Signed-off-by: Warren Usui <wusui@redhat.com>
teuthology/task/ceph_ansible.py

index 25cce9784a7841ead83bf48fa4635f5616bd9817..1a63fe02c73ea58c1d9708c9fdf87960b83c4a2e 100644 (file)
@@ -40,6 +40,10 @@ class CephAnsible(Task):
         * Set ``monitor_interface`` for each host if ``monitor_interface`` is
           unset
         * Set ``public_network`` for each host if ``public_network`` is unset
+
+    The machine that ceph-ansible runs on can be specified using the
+    installer.0 role.  If installer.0 is not used, the first mon will be the
+    machine on which ceph-ansible runs.
     """.format(git_base=teuth_config.ceph_git_base_url)
 
     groups_to_roles = dict(
@@ -112,10 +116,15 @@ class CephAnsible(Task):
             '-i', 'inven.yml', 'site.yml'
         ]
         log.debug("Running %s", args)
-        # use the first mon node as installer node
-        (ceph_installer,) = self.ctx.cluster.only(
-            misc.get_first_mon(self.ctx,
-                               self.config)).remotes.iterkeys()
+        # If there is an installer.0 node, use that for the installer.
+        # Otherwise, use the first mon node as installer node.
+        ansible_loc = self.ctx.cluster.only('installer.0')
+        if ansible_loc.remotes:
+            (ceph_installer,) = ansible_loc.remotes.iterkeys()
+        else:
+            (ceph_installer,) = self.ctx.cluster.only(
+                misc.get_first_mon(self.ctx,
+                                   self.config)).remotes.iterkeys()
         self.ceph_installer = ceph_installer
         self.args = args
         if self.config.get('rhbuild'):