From a869b638d6afaf99cd2a59627bbdea2ef72a3b3f Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Thu, 6 May 2021 16:33:24 -0400 Subject: [PATCH] Write fully populated envfile to pass to podman Without this, manually reproducing the container's environment is really difficult. --- ansible_runner/runner.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ansible_runner/runner.py b/ansible_runner/runner.py index 7451e6a52..3b1b00afa 100644 --- a/ansible_runner/runner.py +++ b/ansible_runner/runner.py @@ -182,7 +182,11 @@ def run(self): # option expecting should have already been written in ansible_runner.runner_config env_file_host = os.path.join(self.config.artifact_dir, 'env.list') with open(env_file_host, 'w') as f: - f.write('\n'.join(list(self.config.env.keys()))) + f.write( + '\n'.join( + ["{}={}".format(key, value) for key, value in self.config.env.items()] + ) + ) else: cwd = self.config.cwd pexpect_env = self.config.env