Simplify gce inventory plugin injector

This consumes the change made in Ansible core
https://github.com/ansible/ansible/pull/54407
which is in Ansible 2.8, allowing the plugin
injection logic to share the script logic and
to be simplified
This commit is contained in:
AlanCoding
2019-04-23 08:31:50 -04:00
parent 864fef4f29
commit c36dbb3448
5 changed files with 13 additions and 12 deletions

View File

@@ -18,8 +18,9 @@ def gce(cred, env, private_data_dir):
project = cred.get_input('project', default='')
username = cred.get_input('username', default='')
env['GCE_EMAIL'] = username
env['GCE_PROJECT'] = project
if 'INVENTORY_UPDATE_ID' not in env:
env['GCE_EMAIL'] = username
env['GCE_PROJECT'] = project
json_cred = {
'type': 'service_account',
'private_key': cred.get_input('ssh_key_data', default=''),