feat: Ansible 15个运维模板 + 主机匹配 + 远程执行
**种子模板(15个):** - 系统信息收集、安全更新、磁盘清理、服务巡检 - 用户SSH管理、Nginx配置、SSL证书检查、配置备份 - 进程诊断、Docker清理、防火墙、时间同步 - 日志轮转、内核调优、网络诊断 - 分类覆盖:maintenance/security/configuration/backup/monitoring **主机匹配 API:** - GET /api/v1/ansible/match-hosts?pattern=&match_type=regex|prefix|contains - 支持正则/前缀/模糊匹配 hostname, IP, tags - 复杂正则回退到 Go 过滤 - 分页支持 **远程执行增强:** - 指定 target_hosts 时自动查询 SSH 信息生成临时 inventory - 未指定时回退到 --connection=local - 自动禁用 StrictHostKeyChecking
This commit is contained in:
1 parent
9af0685e90
commit
c9b6647831
4 files changed
+528
-6
No files matched your search
@@ -451,6 +451,9 @@ func Register(r *gin.Engine, db *gorm.DB, log *zap.Logger, cfg *config.Config, c
|
||||
ansible.POST("/inventories", ansibleHandler.CreateInventory)
|
||||
ansible.PUT("/inventories/:id", ansibleHandler.UpdateInventory)
|
||||
ansible.DELETE("/inventories/:id", ansibleHandler.DeleteInventory)
|
||||
|
||||
// 主机匹配(资产服务器查询)// Logan.Li
|
||||
ansible.GET("/match-hosts", ansibleHandler.MatchHosts)
|
||||
}
|
||||
|
||||
// 日志监控路由 // Logan.Li
|
||||
|
||||
Reference in new issue
Block a user