mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Working GCE inventory sync.
This commit is contained in:
parent
5df7833038
commit
a1059dabae
@ -1227,4 +1227,4 @@ class Command(NoArgsCommand):
|
||||
if exc and isinstance(exc, CommandError):
|
||||
sys.exit(1)
|
||||
elif exc:
|
||||
raise exc
|
||||
raise
|
||||
|
||||
@ -60,7 +60,7 @@ PERMISSION_TYPE_CHOICES = [
|
||||
(PERM_INVENTORY_CHECK, _('Deploy To Inventory (Dry Run)')),
|
||||
]
|
||||
|
||||
CLOUD_INVENTORY_SOURCES = ['ec2', 'rax']
|
||||
CLOUD_INVENTORY_SOURCES = ['ec2', 'rax', 'vmware', 'gce', 'azure']
|
||||
|
||||
|
||||
class VarsDictProperty(object):
|
||||
|
||||
@ -840,8 +840,8 @@ class RunInventoryUpdate(BaseTask):
|
||||
for subkey in ('username', 'host', 'project'):
|
||||
passwords['source_%s' % subkey] = getattr(credential, subkey)
|
||||
for passkey in ('password', 'ssh_key_data'):
|
||||
k = 'source_%s' % subkey
|
||||
passwords[k] = decrypt_field(credential, subkey)
|
||||
k = 'source_%s' % passkey
|
||||
passwords[k] = decrypt_field(credential, passkey)
|
||||
return passwords
|
||||
|
||||
def build_env(self, inventory_update, **kwargs):
|
||||
@ -977,7 +977,7 @@ class RunInventoryUpdate(BaseTask):
|
||||
|
||||
# We might have a flag for an instance ID variable; if we do,
|
||||
# add it to the shell arguments.
|
||||
if getattr(settings, '%s_INSTANCE_ID_VAR' % src.upper()):
|
||||
if getattr(settings, '%s_INSTANCE_ID_VAR' % src.upper(), False):
|
||||
args.extend([
|
||||
'--instance-id-var',
|
||||
getattr(settings, '%s_INSTANCE_ID_VAR' % src.upper()),
|
||||
|
||||
0
awx/plugins/inventory/gce.py
Normal file → Executable file
0
awx/plugins/inventory/gce.py
Normal file → Executable file
0
awx/plugins/inventory/vmware.py
Normal file → Executable file
0
awx/plugins/inventory/vmware.py
Normal file → Executable file
@ -434,6 +434,7 @@ GCE_ENABLED_VALUE = 'running'
|
||||
GCE_GROUP_FILTER = r'^.+$'
|
||||
GCE_HOST_FILTER = r'^.+$'
|
||||
GCE_EXCLUDE_EMPTY_GROUPS = True
|
||||
GCE_INSTANCE_ID_VAR = None
|
||||
|
||||
|
||||
# ---------------------
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user