welliamcao / opsmanage Goto Github PK
View Code? Open in Web Editor NEW自动化运维平台: 代码及应用部署CI/CD、资产管理CMDB、计划任务管理平台、SQL审核|回滚、任务调度、站内WIKI
License: GNU General Public License v2.0
自动化运维平台: 代码及应用部署CI/CD、资产管理CMDB、计划任务管理平台、SQL审核|回滚、任务调度、站内WIKI
License: GNU General Public License v2.0
是否有在线演示环境?感觉部署起来有点麻烦,所以想在看看部署后的效果是什么样子的
Downloading/unpacking Celery
Downloading celery-4.0.2-py2.py3-none-any.whl (396kB): 396kB downloaded
Downloading/unpacking billiard>=3.5.0.2,<3.6.0 (from Celery)
Downloading billiard-3.5.0.2.tar.gz (157kB): 157kB downloaded
Running setup.py (path:/tmp/pip_build_root/billiard/setup.py) egg_info for package billiard
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip_build_root/billiard/setup.py", line 90, in
raise ValueError('Versions of Python before 2.7 are not supported')
ValueError: Versions of Python before 2.7 are not supported
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 17, in
File "/tmp/pip_build_root/billiard/setup.py", line 90, in
raise ValueError('Versions of Python before 2.7 are not supported')
ValueError: Versions of Python before 2.7 are not supported
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/billiard
Storing debug log for failure in /root/.pip/pip.log
是按照readme文档步骤安装的,谢谢
1资产管理部分,是否支持自定义属性(或叫字段)?
2不提供批量导入或者接口操作吗?
添加资产显示错误,更新本地数据库依旧如此。【资产编号重复,添加资产失败~】资产编号貌似有问题
您好,对您这个项目很感兴趣,README里面部署过程中安装了easy_install,但是我看后面部署过程都没用过这个命令,这是为什么?有些软件的版本有要求么?比如pip。谢谢!
项目部署失败:xxx正在部署改项目,请稍后再提交部署。
可是当前并没有部署。
[root@localhost OpsManage]# python manage.py runserver 192.168.26:8000
Performing system checks...
Unhandled exception in thread started by <function wrapper at 0x7fc72425a938>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 229, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/channels/management/commands/runserver.py", line 55, in inner_run
self.check(display_num_errors=True)
File "/usr/local/lib/python2.7/site-packages/django/core/management/base.py", line 482, in check
include_deployment_checks=include_deployment_checks,
File "/usr/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 72, in run_checks
new_errors = check(app_configs=app_configs)
File "/usr/local/lib/python2.7/site-packages/django/core/checks/model_checks.py", line 28, in check_all_models
errors.extend(model.check(**kwargs))
File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", line 1205, in check
errors.extend(cls._check_fields(**kwargs))
File "/usr/local/lib/python2.7/site-packages/django/db/models/base.py", line 1282, in _check_fields
errors.extend(field.check(**kwargs))
File "/usr/local/lib/python2.7/site-packages/django/db/models/fields/init.py", line 934, in check
errors = super(AutoField, self).check(**kwargs)
File "/usr/local/lib/python2.7/site-packages/django/db/models/fields/init.py", line 207, in check
errors.extend(self._check_backend_specific_checks(**kwargs))
File "/usr/local/lib/python2.7/site-packages/django/db/models/fields/init.py", line 306, in _check_backend_specific_checks
return connection.validation.check_field(self, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/mysql/validation.py", line 18, in check_field
field_type = field.db_type(connection)
File "/usr/local/lib/python2.7/site-packages/django/db/models/fields/init.py", line 614, in db_type
return connection.data_types[self.get_internal_type()] % data
File "/usr/local/lib/python2.7/site-packages/django/db/init.py", line 36, in getattr
return getattr(connections[DEFAULT_DB_ALIAS], item)
File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py", line 59, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 196, in data_types
if self.features.supports_microsecond_precision:
File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py", line 59, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/mysql/features.py", line 52, in supports_microsecond_precision
return self.connection.mysql_version >= (5, 6, 4) and Database.version_info >= (1, 2, 5)
File "/usr/local/lib/python2.7/site-packages/django/utils/functional.py", line 59, in get
res = instance.dict[self.name] = self.func(instance)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 371, in mysql_version
with self.temporary_connection():
File "/usr/local/lib/python2.7/contextlib.py", line 17, in enter
return self.gen.next()
File "/usr/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 462, in temporary_connection
cursor = self.cursor()
File "/usr/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 162, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "/usr/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 135, in _cursor
self.ensure_connection()
File "/usr/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
self.connect()
File "/usr/local/lib/python2.7/site-packages/django/db/backends/base/base.py", line 119, in connect
self.connection = self.get_new_connection(conn_params)
File "/usr/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 276, in get_new_connection
conn = Database.connect(**conn_params)
File "/usr/local/lib/python2.7/site-packages/MySQLdb/init.py", line 80, in Connect
from MySQLdb.connections import Connection
File "/usr/local/lib/python2.7/site-packages/pymysql/connections.py", line 20, in
from .constants import CLIENT, COMMAND, CR, FIELD_TYPE, SERVER_STATUS
ImportError: cannot import name COMMAND
这是什么错误
可以支持windows部署代码吗?
调用tasks中的方法 recordAssets.delay() delay方法没有执行
celery配置为
''' celery config ''' djcelery.setup_loader() BROKER_URL = 'redis://192.168.1.***:6379/3' CELERY_RESULT_BACKEND = 'djcelery.backends.database.DatabaseBackend' CELERY_TASK_SERIALIZER = 'json' CELERY_RESULT_SERIALIZER = 'pickle' CELERY_ACCEPT_CONTENT = ['json', 'pickle'] CELERYBEAT_SCHEDULER = 'djcelery.schedulers.DatabaseScheduler' CELERY_TASK_RESULT_EXPIRES = 60 * 60 * 24 CELERYD_MAX_TASKS_PER_CHILD = 40 CELERY_TRACK_STARTED = True CELERY_TIMEZONE='Asia/Shanghai' platforms.C_FORCE_ROOT = True
当我有一个master 一个Dev2个分支的时候 。我初始化后,点击"部署"后,在分支里面只看的到master分支,看不到dev分支。就是说初始化clone的时候 本地只有master分支,但是我要发布的是dev分支的东西。怎么弄
1.deploy_run.html里面关于svn库和分支版本的问题
{% if project.project_model == 'branch' and project.project_repertory == 'git' %}
{% elif project.project_model == 'tag' and project.project_repertory == 'git' %}
{% else %}
如果我用的svn,分支是tag那就是要执行else下面的,但是下面的是不POST的,我在deploy.py里面的deploy_run函数里面看到elif project.project_model == 'tag':
bName = request.POST.get('project_branch')这句,都没有POST数据这里怎么获取的,我不是太清楚。
还有if request.POST.get('project_mode',None) == "rollback":这句我在deploy_run.html里面没看到有name为project_mode的呢?
谢谢解答
Ubuntu 16.04系统环境下,启动gateone service会报错:Unit gateone.service not found
,可用如下方式解决:
添加/lib/systemd/system/gateone.service
[Unit]
Description=Web-based terminal
[Service]
Type=simple
PIDFile=/tmp/gateone.pid
WorkingDirectory=/var/lib/gateone
ExecStart=/usr/local/bin/gateone
Restart=on-abort
[Install]
WantedBy=multi-user.target
apps_models.html与ansible.py中是不是有几处ansible_args错写成ansible_agrs了?
导致ansible运行模块时获取不到args
页面报错,但是看不出什么原因,后台能输出一些日志吗
+----------------------------+
Tables_in_opsmanage |
---|
auth_group |
auth_group_permissions |
auth_permission |
auth_user |
auth_user_groups |
auth_user_user_permissions |
celery_taskmeta |
celery_tasksetmeta |
django_admin_log |
django_content_type |
django_migrations |
django_session |
djcelery_crontabschedule |
djcelery_intervalschedule |
djcelery_periodictask |
djcelery_periodictasks |
djcelery_taskstate |
djcelery_workerstate |
+----------------------------+ |
只有这些表被创建了,是为啥 |
不然代码里面branch只会有默认的branch 比如只有master
可以执行以下命令获取:
git branch -r | grep -v '->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@welliamcao 我就想问下,为什么没有使用多个APP来做,而是采用都在一个APP这样的架构来做呢
感觉angular比较适合前端spa应用
不知道大家有没考虑前端用angular(4)
初始化后,点击部署到部署服务器-版本选择,没有可以选择版本。点击确认部署报错:(错误,请注意必填项不能为空)
没有弹出可用类型
ansible 模块管理界面
模块类型选择“自定义”后,再次在模块类型选择“ping”,下面的“自定义模块“不会隐藏
apps_model.html添加
else if (value=="ping"){
document.getElementById("ansible_args").value="";
document.getElementById("custom_model").style.display = "none";
}
你好,想问下我的剧本执行有问题,想请教下,你在测试的时候有没有试过当执行错误的剧本的时候什么反应的,
[root@www01 OpsManage]# python manage.py runserver ip:8000
Performing system checks...
System check identified no issues (0 silenced).
July 22, 2017 - 22:33:29
Django version 1.8.17, using settings 'OpsManage.settings'
Starting development server at http://ip:8000/
Quit the server with CONTROL-C.
Error: [Errno -2] Name or service not known
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 ::1:25 :::* LISTEN
mysql> show tables;
+--------------------------------------------+
| Tables_in_opsmanage |
+--------------------------------------------+
| OpsManage_ansible_callback_model_result |
| OpsManage_ansible_callback_playbook_result |
| auth_group |
| auth_group_permissions |
| auth_permission |
| auth_user |
| auth_user_groups |
| auth_user_user_permissions |
| celery_taskmeta |
mysql> select id,password from auth_user;
+----+-------------------------------------------------------------------------------+
| id | password |
+----+-------------------------------------------------------------------------------+
| 1 | pbkdf2_sha256$20000$0dVCzn988kfU$vELZOB1+wHjuQNq3O2UlqvGJkqL1j1LE/BNOCQWk1vQ= |
+----+-------------------------------------------------------------------------------+
1 row in set (0.00 sec)
剧本能不能 给个demo 参考下, 我每次 导入的剧本 都是 不能执行
1.如果我用的是svn来控制版本,那svn是不是要安装标准的模式下面分trunk,branch,tag来做,前面我只用一个目录来做,部署的时候一直不成功,还没找到原因。
2.还有个问题是,我觉得是不是在添加服务器的时候就确定这台服务器属于某个项目,这样在发布的时候就不用选择了,这样是不是更好。如果是在部署的时候还能修改,会不会发生漏更的问题?
谢谢回答
如果填入部署之后执行的命令部署的时候就会失败,为空的时候 就部署成功。打印2次的dataList如下:
[{'msg': 'Ansible synchronize with src=/data/webserver/project/huimu/ dest=/data/game/ links=yes recursive=yes compress=yes delete=yes rsync_opts="--exclude ".git" " execute success.', 'ip': u'192.168.1.151', 'status': 'succeed'}]
命令为:/etc/init.d/tomcat restart
[{'msg': u'', 'ip': u'192.168.13.151', 'status': 'failed'}]
不清楚这是什么原因。。。有遇到过吗
新增资产时,点击确认提交后,返回资产编号重复,添加资产失败,但实际是添加成功的,入库也是正常。
请求日志如下
[11/Sep/2017 17:14:50] "GET /assets_add HTTP/1.1" 200 35294
[11/Sep/2017 17:14:51] "GET /api/order/admin/ HTTP/1.1" 200 2
[11/Sep/2017 17:15:53] "POST /api/server/ HTTP/1.1" 500 16475
资产管理
执行 python manage.py migrate
后:
Operations to perform:
Apply all migrations: admin, auth, contenttypes, djcelery, sessions
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying djcelery.0001_initial... OK
Applying sessions.0001_initial... OK
opsmanage 库中没有 opsmanage_*
表
看了下 页面, 没有像部署的时候 显示可选的主机hosts
你好大神,本人python初学者,在运行完python manage.py runserver 192.168.1.234:8000之后,是没有发生错误的,信息如下
Django version 1.8.17, using settings 'OpsManage.settings'
Starting development server at http://192.168.1.234:8000/
Quit the server with CONTROL-C.
但是点开http://192.168.1.234:8000/之后,django会报错,报错信息如下
Request Method: | GET
Request URL: http://192.168.1.234:8000/
Django Version: 1.8.17
Exception Type: ImproperlyConfigured
Exception Value: Cannot override the namespace for a dynamic module that provides a namespace
Exception Location: /usr/local/lib/python2.7/site-packages/django/conf/urls/__init__.py in include, line 26
Python Executable: /usr/local/bin/python
Python Version: 2.7.12
请问这是什么原因造成的啊?
查看GateOne日志出现以下错误:
SSL routines:SSL_CTX_use_certificate_chain_file:PEM lib
可以通过pip安装以下两个模块解决:
pip install pyopenssl ordereddict
之前提到过这个问题 python为2.7.13 ansible、uwsgi都装到/usr/local/lib/python2.7/site-packages下了。
[Start] Ansible 模块类型: synchronize 命令内容:src=/root/a dest=/tmp/ compress=yes 192.168.3.165 | FAILED! => { "_ansible_parsed": false, "_ansible_no_log": false, "module_stderr": "unable to load configuration from /root/.ansible/tmp/ansible-tmp-1511777799.47-133894082603415/synchronize.py\n", "module_stdout": "", "failed": true, "msg": "MODULE FAILURE" }
首先建议要安装的模块写到requirements.txt文件中。
django==1.8.17
Celery
django-celery
celery-with-redis
djangorestframework
paramiko
ansible==2.2.2
redis
supervisor
redis
MySQL-python
DBUtils
其次,第一步yum安装各种包时,应该是需要gcc的,我用docker新环境,没有gcc,pip报错,大概就是:https://stackoverflow.com/questions/8102292/problems-installing-pycrypto-on-osx
请问使用nginx+django有这样部署过吗
资产管理 和 发布 想让不同的人管 已经建了两个不同的组 ,对组分配了不同的 权限,但是资产管理组下的人 只有 基础配置有权限 其它的 还是没权限 ,即便对这个账户单独设置其它几个菜单权限也没用,
最终还是只有超级用户 能够访问所有的菜单
requirements.txt
中添加:
service_identity
以解决 migrate 生成数据表时的warning:
:0: UserWarning: You do not have a working installation of the service_identity module: 'No module named service_identity'. Please install it from <https://pypi.python.org/pypi/service_identity> and make sure all of its dependencies are satisfied. Without the service_identity module, Twisted can perform only rudimentary TLS client hostname verification. Many valid certificate/hostname mappings may be rejected.
AND
requirements.txt
能不能按首字母排序一下 😂
比如这样:
ansible==2.2.2
asgi-redis==1.4.3
asgiref==1.1.2
Celery==3.1.20
celery-with-redis
channels==1.1.7
DBUtils
Django==1.11.7
django-celery==3.2.2
djangorestframework==3.5.3
MySQL-python
paramiko
redis
service_identity
supervisor
xlrd
我想问下settings.py中的你定义的redis 的这个参数BROKER_URL = 'redis://121.199.26.4:6379/3' 端口号后面的3是什么意思?(你redis创建好后需要创建key吗?)还有我启动你下面的异步Celery ,但是追加的日志中总是报无法连接ERROR/MainProcess] consumer: Cannot connect to redis://121.199.26.4:6379/3: .
Trying again in 32.00 seconds... (尝试安装rabbitmq也无果)
基础资产配置中添加 中文 无效果,即便添加英文或数字后 修改成中文也不成功
由于exclude是从上面获取 格式如下:exclude = --exclude "{file}" 因此当赋值到synchronize模块参数的时候 不符合该模块语法 rsync_opts="{exclude}"
因此会提示 rsync语法错误
如题,还有审批什么的
单词漏写会一个报错哦,master分支有错误,beta分支没有。
已在commit : "修复修改页面模板出现None值的bug" 出错行指出。
代码发布中,很多项目的发布方法可能不一样,没有找到输入关于发布的命令,或者脚本,怎么发布的?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.