From fb1099234e20aece302c532a84031b8a04142150 Mon Sep 17 00:00:00 2001 From: Luke Sneeringer Date: Fri, 1 Aug 2014 11:13:55 -0500 Subject: [PATCH] Adding GCE/Azure envvar support to jobs. --- awx/main/tasks.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index daed8d01e1..86ba12a5e4 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -492,6 +492,13 @@ class RunJob(BaseTask): elif cloud_cred and cloud_cred.kind == 'rax': env['RAX_USERNAME'] = cloud_cred.username env['RAX_API_KEY'] = decrypt_field(cloud_cred, 'password') + elif cloud_cred and cloud_cred.kind == 'gce': + env['GCE_EMAIL'] = cloud_cred.username + env['GCE_PROJECT'] = cloud_cred.project + env['GCE_PEM_FILE_PATH'] = kwargs['private_data_file'] + elif cloud_cred and cloud_cred.kind == 'azure': + env['AZURE_SUBSCRIPTION_ID'] = cloud_cred.username + env['AZURE_CERT_PATH'] = kwargs['private_data_file'] return env