updated host gropups and playbook

This commit is contained in:
ske087
2026-06-26 11:13:20 +03:00
parent dbc1c882eb
commit ead8a7bb9d
4 changed files with 56 additions and 7 deletions
+3 -1
View File
@@ -37,9 +37,10 @@ def get_inventory_raw():
@ansible_bp.route('/inventory/sync', methods=['POST'])
def sync_inventory():
"""Sync all active app devices into monitoring_devices inventory group"""
"""Sync all active app devices into monitoring_devices and wmt_clients inventory groups"""
try:
result = ansible_service.sync_devices_to_inventory()
ansible_service.sync_wmt_devices_to_inventory()
status = 200 if result.get('success') else 400
return jsonify(result), status
except Exception as e:
@@ -116,6 +117,7 @@ def refresh_inventory():
"""Refresh Ansible inventory from database (legacy alias for /sync)"""
try:
result = ansible_service.sync_devices_to_inventory()
ansible_service.sync_wmt_devices_to_inventory()
return jsonify(result), 200 if result.get('success') else 400
except Exception as e:
logging.error(f"Error refreshing inventory: {e}")