Merge pull request #551 from ansible/tower_inventory_source

Tower inventory source
This commit is contained in:
Matthew Jones
2017-10-27 08:41:24 -04:00
committed by GitHub
16 changed files with 210 additions and 14 deletions

View File

@@ -64,6 +64,7 @@ class V1Credential(object):
('openstack', 'OpenStack'),
('ovirt4', 'oVirt4'),
('insights', 'Insights'),
('tower', 'Ansible Tower'),
]
FIELDS = {
'kind': models.CharField(
@@ -1067,3 +1068,37 @@ def ovirt4(cls):
}
},
)
@CredentialType.default
def tower(cls):
return cls(
kind='cloud',
name='Ansible Tower',
managed_by_tower=True,
inputs={
'fields': [{
'id': 'host',
'label': 'Ansible Tower Hostname',
'type': 'string',
'help_text': ('The Ansible Tower base URL to authenticate with.')
}, {
'id': 'username',
'label': 'Username',
'type': 'string'
}, {
'id': 'password',
'label': 'Password',
'type': 'string',
'secret': True,
}],
'required': ['host', 'username', 'password'],
},
injectors={
'env': {
'TOWER_HOST': '{{host}}',
'TOWER_USERNAME': '{{username}}',
'TOWER_PASSWORD': '{{password}}',
}
},
)