# AutoHandle **Repository Path**: Davin168/auto-handle ## Basic Information - **Project Name**: AutoHandle - **Description**: 自动化,运维编排系统,根据yaml编写编排实现自动化操控业务。 - **Primary Language**: Python - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-04-27 - **Last Updated**: 2023-04-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # AutoHandle ###### 介绍 使用模块化实现功能,通过编写编排文件,自动化调用模块功能,实现运维自动化 目录结构: - instructions #说明文档 - module #功能模块 - service #公共方法 - yaml #配置文件 - main.py #入口文件 ###### 准备环境 需要安装ansible ``` yum install ansible ``` 发布系统调用ansible的api,默认读取/etc/ansible/hosts文件,hosts文件配置如下 ``` [api] #群组 192.168.0.5 ansible_ssh_host=192.168.0.5 ansible_ssh_port=22 ansible_ssh_user=root ansible_connection=ssh 192.168.0.6 ansible_ssh_host=192.168.0.6 ansible_ssh_port=22 ansible_ssh_user=root ansible_connection=ssh #别名 ansible_ssh_host=内网/公网ip ansible_ssh_port=端口 ansible_ssh_user=连接用户 ansible_connection=连接方式 ``` ###### 使用教程 安装python模块 ``` pip3 install -r requirements.txt ``` 根据业务情况创建yaml文件,将yaml文件放入yaml目录处,随意命名 如:yaml/test.yml ###### 执行 ```python python3 main.py --config "test.yml" ``` ###### 模块介绍 1、[nginx_config模块](instructions/nginx_config.md) 2、[ansible模块](instructions/ansible.md) 3、[ansible-playbook模块](instructions/ansible-playbook.md) 4、[ali_cdn模块](instructions/ali_cdn.md)