|
|
@ -290,6 +290,7 @@ def create_instance_template(module, gce):
|
|
|
|
external_ip = module.params.get('external_ip')
|
|
|
|
external_ip = module.params.get('external_ip')
|
|
|
|
service_account_permissions = module.params.get(
|
|
|
|
service_account_permissions = module.params.get(
|
|
|
|
'service_account_permissions')
|
|
|
|
'service_account_permissions')
|
|
|
|
|
|
|
|
service_account_email = module.params.get('service_account_email')
|
|
|
|
on_host_maintenance = module.params.get('on_host_maintenance')
|
|
|
|
on_host_maintenance = module.params.get('on_host_maintenance')
|
|
|
|
automatic_restart = module.params.get('automatic_restart')
|
|
|
|
automatic_restart = module.params.get('automatic_restart')
|
|
|
|
preemptible = module.params.get('preemptible')
|
|
|
|
preemptible = module.params.get('preemptible')
|
|
|
@ -369,6 +370,9 @@ def create_instance_template(module, gce):
|
|
|
|
bad_perms.append(perm)
|
|
|
|
bad_perms.append(perm)
|
|
|
|
if len(bad_perms) > 0:
|
|
|
|
if len(bad_perms) > 0:
|
|
|
|
module.fail_json(msg='bad permissions: %s' % str(bad_perms))
|
|
|
|
module.fail_json(msg='bad permissions: %s' % str(bad_perms))
|
|
|
|
|
|
|
|
if service_account_email is not None:
|
|
|
|
|
|
|
|
ex_sa_perms.append({'email': str(service_account_email)})
|
|
|
|
|
|
|
|
else:
|
|
|
|
ex_sa_perms.append({'email': "default"})
|
|
|
|
ex_sa_perms.append({'email': "default"})
|
|
|
|
ex_sa_perms[0]['scopes'] = service_account_permissions
|
|
|
|
ex_sa_perms[0]['scopes'] = service_account_permissions
|
|
|
|
gce_args['service_accounts'] = ex_sa_perms
|
|
|
|
gce_args['service_accounts'] = ex_sa_perms
|
|
|
|