mirror of
https://github.com/ansible/awx.git
synced 2026-02-22 21:46:00 -03:30
Working GCE inventory sync.
This commit is contained in:
@@ -1227,4 +1227,4 @@ class Command(NoArgsCommand):
|
|||||||
if exc and isinstance(exc, CommandError):
|
if exc and isinstance(exc, CommandError):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
elif exc:
|
elif exc:
|
||||||
raise exc
|
raise
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ PERMISSION_TYPE_CHOICES = [
|
|||||||
(PERM_INVENTORY_CHECK, _('Deploy To Inventory (Dry Run)')),
|
(PERM_INVENTORY_CHECK, _('Deploy To Inventory (Dry Run)')),
|
||||||
]
|
]
|
||||||
|
|
||||||
CLOUD_INVENTORY_SOURCES = ['ec2', 'rax']
|
CLOUD_INVENTORY_SOURCES = ['ec2', 'rax', 'vmware', 'gce', 'azure']
|
||||||
|
|
||||||
|
|
||||||
class VarsDictProperty(object):
|
class VarsDictProperty(object):
|
||||||
|
|||||||
@@ -840,8 +840,8 @@ class RunInventoryUpdate(BaseTask):
|
|||||||
for subkey in ('username', 'host', 'project'):
|
for subkey in ('username', 'host', 'project'):
|
||||||
passwords['source_%s' % subkey] = getattr(credential, subkey)
|
passwords['source_%s' % subkey] = getattr(credential, subkey)
|
||||||
for passkey in ('password', 'ssh_key_data'):
|
for passkey in ('password', 'ssh_key_data'):
|
||||||
k = 'source_%s' % subkey
|
k = 'source_%s' % passkey
|
||||||
passwords[k] = decrypt_field(credential, subkey)
|
passwords[k] = decrypt_field(credential, passkey)
|
||||||
return passwords
|
return passwords
|
||||||
|
|
||||||
def build_env(self, inventory_update, **kwargs):
|
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,
|
# We might have a flag for an instance ID variable; if we do,
|
||||||
# add it to the shell arguments.
|
# 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([
|
args.extend([
|
||||||
'--instance-id-var',
|
'--instance-id-var',
|
||||||
getattr(settings, '%s_INSTANCE_ID_VAR' % src.upper()),
|
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_GROUP_FILTER = r'^.+$'
|
||||||
GCE_HOST_FILTER = r'^.+$'
|
GCE_HOST_FILTER = r'^.+$'
|
||||||
GCE_EXCLUDE_EMPTY_GROUPS = True
|
GCE_EXCLUDE_EMPTY_GROUPS = True
|
||||||
|
GCE_INSTANCE_ID_VAR = None
|
||||||
|
|
||||||
|
|
||||||
# ---------------------
|
# ---------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user