pull/26/head
ibuler 2015-12-11 15:32:06 +08:00
parent 280560f286
commit 9979fdf6de
2 changed files with 16 additions and 15 deletions

View File

@ -1,27 +1,28 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from ansible.inventory.group import Group
from ansible.inventory.host import Host
from ansible.inventory import Inventory
from ansible.runner import Runner
from ansible.playbook import PlayBook
from ansible import callbacks
from ansible import utils
from passlib.hash import sha512_crypt
from utils import get_rand_pass
from jumpserver.api import logger
from tempfile import NamedTemporaryFile from tempfile import NamedTemporaryFile
import os.path
from ansible.inventory.group import Group
from ansible.inventory.host import Host
from ansible.inventory import Inventory
from ansible.runner import Runner
from ansible.playbook import PlayBook
from ansible import callbacks
from ansible import utils
import ansible.constants as C
from passlib.hash import sha512_crypt
from django.template.loader import get_template from django.template.loader import get_template
from django.template import Context from django.template import Context
import os.path from utils import get_rand_pass
from jumpserver.api import logger
API_DIR = os.path.dirname(os.path.abspath(__file__)) API_DIR = os.path.dirname(os.path.abspath(__file__))
ANSIBLE_DIR = os.path.join(API_DIR, 'playbooks') ANSIBLE_DIR = os.path.join(API_DIR, 'playbooks')
C.HOST_KEY_CHECKING = False
class AnsibleError(StandardError): class AnsibleError(StandardError):

View File

@ -133,7 +133,7 @@ $('#ruleForm').validator({
fields: { fields: {
"name": { "name": {
rule: "required;check_name", rule: "required",
tip: "输入规则名称", tip: "输入规则名称",
msg: {required: "规则名称必填"} msg: {required: "规则名称必填"}
}, },