Giter VIP home page Giter VIP logo

ericzhong2010 / ops Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pythonzm/ops

0.0 1.0 0.0 41.91 MB

基于centos6+python3.6+django2+ansible2.4+celery4.2 运维管理系统,目前实现功能:用户和用户组管理、资产管理、集成ansible2.4、简易堡垒机(主机分配支持rdp以及vnc、用户分配、文件上传下载、配置禁用命令清单、操作录像回放功能)、CI/CD(支持git仓库和svn仓库)、数据库管理(一部分)、celery任务编排、知识库及文件共享

Python 96.10% CSS 3.43% Shell 0.46%

ops's Introduction

ops

基于centos6+python3.6+django2+ansible2.4+celery4.2 运维管理系统-开发中,目前实现功能:用户和用户组管理、日程管理、资产管理、集成ansible、简易堡垒机(主机分配(支持Linux和Windows)、用户分配、文件上传下载、配置禁用命令清单、操作录像回放功能)、数据库管理(一部分)、CI/CD(支持git仓库和svn仓库)、celery任务编排、基于markdown编辑器的知识库支持实时预览和全局搜索结果高亮和文件共享中心

安装

一、安装python3.6

建议安装虚拟环境,具体步骤参考https://github.com/pyenv/pyenv

二、安装模块

git clone https://github.com/pythonzm/Ops.git
pip install -r requirements.txt

// 因为django-celery-results的pip包与github上不一致,所以使用下面方法安装
pip install https://github.com/celery/django-celery-results/zipball/master#egg=django-celery-results

三、安装mysql

建议MySQL5.6,安装过程略

vim /etc/my.cnf
## 设置字符集
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake

## 忽略大小写
lower_case_table_names=1

/etc/init.d/mysqld restart
# mysql -uroot -p
mysql>create database ops DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql>grant all privileges on ops.* to root@'%' identified by 'password';
mysql>quit

四、安装redis(略)

五、安装mongodb(略)

六、配置celery后台运行,或查看官网

cp conf/celeryd.conf /etc/default/celeryd
### 将配置文件里的内容按照实际情况更改

cp conf/celeryd.server /etc/init.d/celeryd
cp conf/celerybeat.server /etc/init.d/celerybeat
/etc/init.d/celeryd start  ##如果出现celeryd无法启动,则添加环境变量:export C_FORCE_ROOT="true"
/etc/init.d/celerybeat start

七、配置获取主机内存脚本

cp conf/get_mem.py /path/to/your ansible python module location  ##可以使用ansbile --version命令查看路径

八、安装Guacamole用于支持web端登录Windows服务器以及开启VNC的服务器(可选)

安装步骤建议参考官方文档:https://guacamole.apache.org/doc/gug/installing-guacamole.html

安装完成后,修改settings.py中的 GUACD_HOST和 GUACD_PORT,改为guac服务启动后监听的地址和端口

功能实现参考:https://github.com/mohabusama/pyguacamole以及https://github.com/jimmy201602/django-guacamole

九、启动服务

需要将Ops目录中的settings.py celery.py按照实际情况更改

python manage.py makemigrations users assets dbmanager fort plan projs task wiki
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver 0.0.0.0:8000

以下为部分截图:

系统操作日志

image image

用户管理

image

日程管理

参考:https://github.com/RobbieHan/sandboxOA image

添加用户以及分配用户权限(采用的django自带的权限系统)等,用户组同理

image

资产概览

image

资产管理,需要关联的项目管理只完成了一部分

image

资产详细,CPU等信息可以通过收集按钮自动获取

image

资产监控

image

ansible执行模块

image

ansible执行playbook

image

ansible role编辑

image

webssh分配主机及用户、用户组

image

webssh终端,包括文件的上传下载

image

webssh操作记录回放

image

web端登录Windows服务器

image

登录日志查看

image

webssh命令查看

image

数据库用户管理,包括新增用户,修改用户,密码,权限

数据库管理用户,该用户需要有grant option权限,并且只能授权该用户所拥有的权限 image

数据库执行命令

image

数据库操作记录

image

CI/CD项目配置

image

注意:如果是启动tomcat项目,启动命令需要加上nohup,由于ansible运行机制问题

CI/CD部署流程

image

CI/CD部署日志

image

自定义项目架构

image

celery任务编排

image

新增文章

image

文章详细

image

用到的一些开源产品

ops's People

Contributors

pythonzm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.