Merge "Quote ansible command and include config file" into feature/zuulv3
diff --git a/zuul/executor/server.py b/zuul/executor/server.py
index dcb2db1..c8abd77 100644
--- a/zuul/executor/server.py
+++ b/zuul/executor/server.py
@@ -28,6 +28,7 @@
import gear
import git
+from six.moves import shlex_quote
import zuul.merger.merger
import zuul.ansible.action
@@ -928,14 +929,17 @@
env_copy['LOGNAME'] = 'zuul'
if trusted:
- env_copy['ANSIBLE_CONFIG'] = self.jobdir.trusted_config
+ config_file = self.jobdir.trusted_config
else:
- env_copy['ANSIBLE_CONFIG'] = self.jobdir.untrusted_config
+ config_file = self.jobdir.untrusted_config
+
+ env_copy['ANSIBLE_CONFIG'] = config_file
with self.proc_lock:
if self.aborted:
return (self.RESULT_ABORTED, None)
- self.log.debug("Ansible command: %s" % (cmd,))
+ self.log.debug("Ansible command: ANSIBLE_CONFIG=%s %s",
+ config_file, " ".join(shlex_quote(c) for c in cmd))
self.proc = subprocess.Popen(
cmd,
cwd=self.jobdir.work_root,