Adding license checks for Tower inventory source

* For Tower the license must match between the source and destination
* For AWX the check is disabled
* Hosts imported from another Tower don't count against your license
  in the local Tower
* Fix up some issues with enablement
* Prevent slashes from being used in the instance filter
* Add &all=1 filter to make sure we pick up all hosts
This commit is contained in:
Matthew Jones
2017-10-26 11:32:16 -04:00
parent d282966aa1
commit 5f3ebc26e0
5 changed files with 26 additions and 6 deletions
+1
View File
@@ -1914,6 +1914,7 @@ class RunInventoryUpdate(BaseTask):
env[str(env_k)] = unicode(inventory_update.source_vars_dict[env_k])
elif inventory_update.source == 'tower':
env['TOWER_INVENTORY'] = inventory_update.instance_filters
env['TOWER_LICENSE_TYPE'] = get_licenser().validate()['license_type']
elif inventory_update.source == 'file':
raise NotImplementedError('Cannot update file sources through the task system.')
# add private_data_files