summaryrefslogtreecommitdiff
path: root/zuul/scheduler.py
diff options
context:
space:
mode:
Diffstat (limited to 'zuul/scheduler.py')
-rw-r--r--zuul/scheduler.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index 4379d5822..57ee5710d 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -32,6 +32,7 @@ from zuul import exceptions
from zuul import version as zuul_version
from zuul import rpclistener
from zuul.lib import commandsocket
+from zuul.lib.ansible import AnsibleManager
from zuul.lib.config import get_default
from zuul.lib.gear_utils import getGearmanFunctions
from zuul.lib.statsd import get_statsd
@@ -323,6 +324,10 @@ class Scheduler(threading.Thread):
if self.config.getboolean('scheduler', 'relative_priority'):
self.use_relative_priority = True
+ default_ansible_version = get_default(
+ self.config, 'scheduler', 'default_ansible_version', None)
+ self.ansible_manager = AnsibleManager(default_ansible_version)
+
def start(self):
super(Scheduler, self).start()
self._command_running = True
@@ -662,6 +667,13 @@ class Scheduler(threading.Thread):
self.config = event.config
try:
self.log.info("Full reconfiguration beginning")
+
+ # Reload the ansible manager in case the default ansible version
+ # changed.
+ default_ansible_version = get_default(
+ self.config, 'scheduler', 'default_ansible_version', None)
+ self.ansible_manager = AnsibleManager(default_ansible_version)
+
for connection in self.connections.connections.values():
self.log.debug("Clear branch cache for: %s" % connection)
connection.clearBranchCache()
@@ -672,7 +684,8 @@ class Scheduler(threading.Thread):
tenant_config, script = self._checkTenantSourceConf(self.config)
self.unparsed_abide = loader.readConfig(
tenant_config, from_script=script)
- abide = loader.loadConfig(self.unparsed_abide)
+ abide = loader.loadConfig(
+ self.unparsed_abide, self.ansible_manager)
for tenant in abide.tenants.values():
self._reconfigureTenant(tenant)
self.abide = abide
@@ -700,7 +713,7 @@ class Scheduler(threading.Thread):
self.connections, self, self.merger,
self._get_key_dir())
abide = loader.reloadTenant(
- self.abide, old_tenant)
+ self.abide, old_tenant, self.ansible_manager)
tenant = abide.tenants[event.tenant_name]
self._reconfigureTenant(tenant)
self.abide = abide