diff --git a/apps/ops/ansible/inventory.py b/apps/ops/ansible/inventory.py index 74913f065..01f8147d3 100644 --- a/apps/ops/ansible/inventory.py +++ b/apps/ops/ansible/inventory.py @@ -326,21 +326,9 @@ class JMSInventory: 'ip': host['ansible_host'], 'id': host.get('jms_asset', {}).get('id') }) - - # 获取跳过的主机 - skipped_hosts = [] - for name, error in self.exclude_hosts.items(): - if any(h['name'] == name for h in error_hosts): - continue - skipped_hosts.append({ - 'name': name, - 'error': error - }) - result = { 'runnable': runnable_hosts, 'error': error_hosts, - 'skipped': skipped_hosts } return result diff --git a/apps/ops/api/inventory.py b/apps/ops/api/inventory.py index 8d65ec39c..c013048e3 100644 --- a/apps/ops/api/inventory.py +++ b/apps/ops/api/inventory.py @@ -19,7 +19,7 @@ class InventoryClassifiedHostsAPI(APIView): asset_ids = request.data.get('assets', []) node_ids = request.data.get('nodes', []) runas_policy = request.data.get('runas_policy', 'privileged_first') - account_prefer = request.data.get('account_prefer', 'root,Administrator') + account_prefer = request.data.get('runas', 'root,Administrator') module = request.data.get('module', 'shell') # 合并节点和资产 assets = list(Asset.objects.filter(id__in=asset_ids).all())