feat: fix migrate_to_wmt playbook; restructure sidebar nav; add Client Name column to WMT dashboard
This commit is contained in:
+12
-1
@@ -129,10 +129,20 @@ def execute():
|
||||
seen.add(h['hostname'])
|
||||
|
||||
settings = ansible_service.load_settings()
|
||||
|
||||
# Discover custom playbooks (exclude built-ins that have dedicated buttons)
|
||||
_builtin_names = {'update_devices', 'restart_service', 'distribute_ssh_keys', 'system_health'}
|
||||
custom_playbooks = []
|
||||
if ansible_service.playbook_dir.exists():
|
||||
for _f in sorted(ansible_service.playbook_dir.glob('*.yml')):
|
||||
if _f.stem.lower() not in _builtin_names:
|
||||
custom_playbooks.append({'name': _f.stem, 'filename': _f.name})
|
||||
|
||||
return render_template('ansible/execute.html',
|
||||
inventory=inventory_data,
|
||||
all_inv_hosts=all_inv_hosts,
|
||||
preselect_playbook=preselect,
|
||||
custom_playbooks=custom_playbooks,
|
||||
use_password_auth=settings.get('use_password_auth', False))
|
||||
except Exception as e:
|
||||
logging.error(f"Error loading execute form: {e}")
|
||||
@@ -141,6 +151,7 @@ def execute():
|
||||
inventory={'groups': {}},
|
||||
all_inv_hosts=[],
|
||||
preselect_playbook='',
|
||||
custom_playbooks=[],
|
||||
use_password_auth=False)
|
||||
|
||||
elif request.method == 'POST':
|
||||
@@ -462,7 +473,7 @@ def playbook_content():
|
||||
from pathlib import Path
|
||||
requested_path = Path(playbook_path)
|
||||
if not requested_path.is_absolute():
|
||||
requested_path = ansible_service.playbook_dir / requested_path
|
||||
requested_path = Path.cwd() / requested_path
|
||||
|
||||
# Ensure path is within playbook directory
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user