Adding initial credential and invsrc for Tower

* New credential type for Tower
* Inventory source definitions and migrations for Tower
* Initial Tower inventory source script
This commit is contained in:
Matthew Jones
2017-10-25 16:19:39 -04:00
parent 70919638ba
commit 6c597ad165
8 changed files with 160 additions and 7 deletions

View File

@@ -64,6 +64,7 @@ class V1Credential(object):
('openstack', 'OpenStack'),
('ovirt4', 'oVirt4'),
('insights', 'Insights'),
('tower', 'Ansible Tower'),
]
FIELDS = {
'kind': models.CharField(
@@ -1061,3 +1062,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_HOSTNAME': '{{host}}',
'TOWER_USERNAME': '{{username}}',
'TOWER_PASSWORD': '{{password}}'
}
},
)