diff --git a/zuul/cmd/launcher.py b/zuul/cmd/launcher.py
index 7f9231b..86266b3 100644
--- a/zuul/cmd/launcher.py
+++ b/zuul/cmd/launcher.py
@@ -22,6 +22,7 @@
 # instead it depends on lockfile-0.9.1 which uses pidfile.
 pid_file_module = extras.try_imports(['daemon.pidlockfile', 'daemon.pidfile'])
 
+import logging
 import os
 import sys
 import signal
@@ -47,6 +48,17 @@
                             help='show zuul version')
         self.args = parser.parse_args()
 
+    def reconfigure_handler(self, signum, frame):
+        signal.signal(signal.SIGHUP, signal.SIG_IGN)
+        self.log.debug("Reconfiguration triggered")
+        self.read_config()
+        self.setup_logging('launcher', 'log_config')
+        try:
+            self.launcher.reconfigure(self.config)
+        except Exception:
+            self.log.exception("Reconfiguration failed:")
+        signal.signal(signal.SIGHUP, self.reconfigure_handler)
+
     def exit_handler(self, signum, frame):
         signal.signal(signal.SIGUSR1, signal.SIG_IGN)
         self.launcher.stop()
@@ -58,10 +70,13 @@
 
         self.setup_logging('launcher', 'log_config')
 
+        self.log = logging.getLogger("zuul.Launcher")
+
         LaunchServer = zuul.launcher.ansiblelaunchserver.LaunchServer
         self.launcher = LaunchServer(self.config)
         self.launcher.start()
 
+        signal.signal(signal.SIGHUP, self.reconfigure_handler)
         signal.signal(signal.SIGUSR1, self.exit_handler)
         signal.signal(signal.SIGUSR2, zuul.cmd.stack_dump_handler)
         while True:
diff --git a/zuul/launcher/ansiblelaunchserver.py b/zuul/launcher/ansiblelaunchserver.py
index 2dd010c..19e8d3f 100644
--- a/zuul/launcher/ansiblelaunchserver.py
+++ b/zuul/launcher/ansiblelaunchserver.py
@@ -14,6 +14,7 @@
 
 import json
 import logging
+import multiprocessing
 import os
 import shutil
 import socket
@@ -24,6 +25,7 @@
 
 import gear
 import yaml
+import jenkins_jobs.builder
 
 
 class JobDir(object):
@@ -50,6 +52,9 @@
     def __init__(self, config):
         self.config = config
         self.hostname = socket.gethostname()
+        self.node_workers = {}
+        self.mpmanager = multiprocessing.Manager()
+        self.jobs = self.mpmanager.dict()
 
     def start(self):
         self._running = True
@@ -64,18 +69,41 @@
         self.worker.waitForServer()
         self.log.debug("Registering")
         self.register()
+        self.loadJobs()
         self.log.debug("Starting worker")
         self.thread = threading.Thread(target=self.run)
         self.thread.daemon = True
         self.thread.start()
 
+    def loadJobs(self):
+        self.log.debug("Loading jobs")
+        builder = JJB()
+        path = self.config.get('launcher', 'jenkins_jobs')
+        builder.load_files([path])
+        builder.parser.expandYaml()
+        unseen = set(self.jobs.keys())
+        for job in builder.parser.jobs:
+            self.jobs[job['name']] = job
+            unseen.discard(job['name'])
+        for name in unseen:
+            del self.jobs[name]
+
     def register(self):
         self.worker.registerFunction("node-assign:zuul")
 
+    def reconfigure(self, config):
+        self.log.debug("Reconfiguring")
+        self.config = config
+        self.loadJobs()
+        for node in self.node_workers.values():
+            node.queue.put(dict(action='reconfigure'))
+
     def stop(self):
         self.log.debug("Stopping")
         self._running = False
         self.worker.shutdown()
+        for node in self.node_workers.values():
+            node.queue.put(dict(action='stop'))
         self.log.debug("Stopped")
 
     def join(self):
@@ -100,32 +128,126 @@
                 self.log.exception("Exception while getting job")
 
     def assignNode(self, job):
+        args = json.loads(job.arguments)
+        worker = NodeWorker(self.config, self.jobs,
+                            args['name'], args['host'],
+                            args['description'], args['labels'])
+        self.node_workers[worker.name] = worker
+
+        worker.process = multiprocessing.Process(target=worker.run)
+        worker.process.start()
+
         data = dict(manager=self.hostname)
         job.sendWorkData(json.dumps(data))
         job.sendWorkComplete()
 
+
+class NodeWorker(object):
+    log = logging.getLogger("zuul.NodeWorker")
+
+    def __init__(self, config, jobs, name, host, description, labels):
+        self.config = config
+        self.jobs = jobs
+        self.name = name
+        self.host = host
+        self.description = description
+        if not isinstance(labels, list):
+            labels = [labels]
+        self.labels = labels
+        self.registered_functions = set()
+        self._running = True
+        self.queue = multiprocessing.Queue()
+
+    def run(self):
+        self._running_job = False
+        server = self.config.get('gearman', 'server')
+        if self.config.has_option('gearman', 'port'):
+            port = self.config.get('gearman', 'port')
+        else:
+            port = 4730
+        self.worker = gear.Worker(self.name)
+        self.worker.addServer(server, port)
+        self.log.debug("Waiting for server")
+        self.worker.waitForServer()
+        self.register()
+
+        self.gearman_thread = threading.Thread(target=self.run_gearman)
+        self.gearman_thread.daemon = True
+        self.gearman_thread.start()
+
+        while self._running:
+            try:
+                self._run_queue()
+            except Exception:
+                self.log.exception("Exception in queue manager:")
+
+    def _run_queue(self):
+        item = self.queue.get()
+        if item['action'] == 'stop':
+            self._running = False
+            self.worker.shutdown()
+        elif item['action'] == 'reconfigure':
+            self.register()
+
+    def run_gearman(self):
+        while self._running:
+            try:
+                self._run_gearman()
+            except Exception:
+                self.log.exception("Exception in gearman manager:")
+
+    def _run_gearman(self):
+        job = self.worker.getJob()
+        try:
+            if job.name not in self.registered_functions:
+                self.log.error("Unable to handle job %s" % job.name)
+                job.sendWorkFail()
+                return
+            self.launch(job)
+        except Exception:
+            self.log.exception("Exception while running job")
+            job.sendWorkException(traceback.format_exc())
+
+    def generateFunctionNames(self, job):
+        # This only supports "node: foo" and "node: foo || bar"
+        ret = set()
+        job_labels = job.get('node')
+        matching_labels = set()
+        if job_labels:
+            job_labels = [x.strip() for x in job_labels.split('||')]
+            matching_labels = set(self.labels) & set(job_labels)
+            if not matching_labels:
+                return ret
+        ret.add('build:%s' % (job['name'],))
+        for label in matching_labels:
+            ret.add('build:%s:%s' % (job['name'], label))
+        return ret
+
+    def register(self):
+        if self._running_job:
+            return
+        new_functions = set()
+        for job in self.jobs.values():
+            new_functions |= self.generateFunctionNames(job)
+        for function in new_functions - self.registered_functions:
+            self.worker.registerFunction(function)
+        for function in self.registered_functions - new_functions:
+            self.worker.unRegisterFunction(function)
+        self.registered_functions = new_functions
+
     def launch(self, job):
+        self._running_job = True
         thread = threading.Thread(target=self._launch, args=(job,))
         thread.start()
 
     def _launch(self, job):
         self.log.debug("Job %s: beginning" % (job.unique,))
+        return  # TODO
         with JobDir() as jobdir:
             self.log.debug("Job %s: job root at %s" %
                            (job.unique, jobdir.root))
             args = json.loads(job.arguments)
-            tasks = []
-            for project in args['projects']:
-                self.log.debug("Job %s: updating project %s" %
-                               (job.unique, project['name']))
-                tasks.append(self.update(project['name'], project['url']))
-            for task in tasks:
-                task.wait()
-            self.log.debug("Job %s: git updates complete" % (job.unique,))
-            merger = self._getMerger(jobdir.git_root)
-            commit = merger.mergeChanges(args['items'])  # noqa
 
-            # TODOv3: Ansible the ansible thing here.
             self.prepareAnsibleFiles(jobdir, args)
             result = self.runAnsible(jobdir)
 
@@ -176,3 +298,9 @@
             return 'SUCCESS'
         else:
             return 'FAILURE'
+
+
+class JJB(jenkins_jobs.builder.Builder):
+    def __init__(self):
+        self.global_config = None
+        self._plugins_list = []
