Add back timeout_var logic

We still need to setup our timeout-var environmental variable,
otherwise devstack gate will fail to read BUILD_TIMEOUT and default
jobs to 120min timeouts.

Change-Id: Ieccba55eaab83074a409efdbb928b4a4fdfdecf7
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
diff --git a/zuul/launcher/ansiblelaunchserver.py b/zuul/launcher/ansiblelaunchserver.py
index 11bcf79..f735e6b 100644
--- a/zuul/launcher/ansiblelaunchserver.py
+++ b/zuul/launcher/ansiblelaunchserver.py
@@ -1341,15 +1341,19 @@
                 inventory.write('\n')
 
         timeout = None
+        timeout_var = None
         for wrapper in jjb_job.get('wrappers', []):
             if isinstance(wrapper, dict):
                 build_timeout = wrapper.get('timeout')
                 if isinstance(build_timeout, dict):
+                    timeout_var = build_timeout.get('timeout-var')
                     timeout = build_timeout.get('timeout')
                     if timeout is not None:
                         timeout = int(timeout) * 60
         if not timeout:
             timeout = ANSIBLE_DEFAULT_TIMEOUT
+        if timeout_var:
+            parameters[timeout_var] = str(timeout * 1000)
 
         with open(jobdir.vars, 'w') as vars_yaml:
             variables = dict(