Merge branch 'pam' of github.com:jumpserver/jumpserver into pam

pull/14903/head
ibuler 2025-02-20 10:04:42 +08:00
commit ae9b44b169
41 changed files with 61 additions and 55 deletions

View File

@ -1,7 +1,7 @@
- hosts: mongodb - hosts: mongodb
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Test MongoDB connection - name: Test MongoDB connection

View File

@ -1,7 +1,7 @@
- hosts: mysql - hosts: mysql
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
db_name: "{{ jms_asset.spec_info.db_name }}" db_name: "{{ jms_asset.spec_info.db_name }}"
check_ssl: "{{ jms_asset.spec_info.use_ssl and not jms_asset.spec_info.allow_invalid_cert }}" check_ssl: "{{ jms_asset.spec_info.use_ssl and not jms_asset.spec_info.allow_invalid_cert }}"
ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}"

View File

@ -1,7 +1,7 @@
- hosts: oracle - hosts: oracle
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Test Oracle connection - name: Test Oracle connection

View File

@ -1,7 +1,7 @@
- hosts: postgre - hosts: postgre
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
check_ssl: "{{ jms_asset.spec_info.use_ssl }}" check_ssl: "{{ jms_asset.spec_info.use_ssl }}"
check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}" check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}"
ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}"

View File

@ -1,7 +1,7 @@
- hosts: sqlserver - hosts: sqlserver
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Test SQLServer connection - name: Test SQLServer connection

View File

@ -9,7 +9,8 @@
database: passwd database: passwd
key: "{{ account.username }}" key: "{{ account.username }}"
register: user_info register: user_info
ignore_errors: yes # 忽略错误如果用户不存在时不会导致playbook失败 failed_when: false
changed_when: false
- name: "Add {{ account.username }} user" - name: "Add {{ account.username }} user"
ansible.builtin.user: ansible.builtin.user:
@ -18,10 +19,10 @@
shell: "{{ params.shell if params.shell | length > 0 else omit }}" shell: "{{ params.shell if params.shell | length > 0 else omit }}"
home: "{{ params.home if params.home | length > 0 else '/home/' + account.username }}" home: "{{ params.home if params.home | length > 0 else '/home/' + account.username }}"
groups: "{{ params.groups if params.groups | length > 0 else omit }}" groups: "{{ params.groups if params.groups | length > 0 else omit }}"
append: yes append: "{{ true if params.groups | length > 0 else false }}"
expires: -1 expires: -1
state: present state: present
when: user_info.failed when: user_info.msg is defined
- name: "Set {{ account.username }} sudo setting" - name: "Set {{ account.username }} sudo setting"
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
@ -31,7 +32,7 @@
line: "{{ account.username + ' ALL=(ALL) NOPASSWD: ' + params.sudo }}" line: "{{ account.username + ' ALL=(ALL) NOPASSWD: ' + params.sudo }}"
validate: visudo -cf %s validate: visudo -cf %s
when: when:
- user_info.failed or params.modify_sudo - user_info.msg is defined or params.modify_sudo
- params.sudo - params.sudo
- name: "Change {{ account.username }} password" - name: "Change {{ account.username }} password"

View File

@ -9,7 +9,8 @@
database: passwd database: passwd
key: "{{ account.username }}" key: "{{ account.username }}"
register: user_info register: user_info
ignore_errors: yes # 忽略错误如果用户不存在时不会导致playbook失败 failed_when: false
changed_when: false
- name: "Add {{ account.username }} user" - name: "Add {{ account.username }} user"
ansible.builtin.user: ansible.builtin.user:
@ -18,10 +19,10 @@
shell: "{{ params.shell if params.shell | length > 0 else omit }}" shell: "{{ params.shell if params.shell | length > 0 else omit }}"
home: "{{ params.home if params.home | length > 0 else '/home/' + account.username }}" home: "{{ params.home if params.home | length > 0 else '/home/' + account.username }}"
groups: "{{ params.groups if params.groups | length > 0 else omit }}" groups: "{{ params.groups if params.groups | length > 0 else omit }}"
append: yes append: "{{ true if params.groups | length > 0 else false }}"
expires: -1 expires: -1
state: present state: present
when: user_info.failed when: user_info.msg is defined
- name: "Set {{ account.username }} sudo setting" - name: "Set {{ account.username }} sudo setting"
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
@ -31,7 +32,7 @@
line: "{{ account.username + ' ALL=(ALL) NOPASSWD: ' + params.sudo }}" line: "{{ account.username + ' ALL=(ALL) NOPASSWD: ' + params.sudo }}"
validate: visudo -cf %s validate: visudo -cf %s
when: when:
- user_info.failed or params.modify_sudo - user_info.msg is defined or params.modify_sudo
- params.sudo - params.sudo
- name: "Change {{ account.username }} password" - name: "Change {{ account.username }} password"

View File

@ -1,7 +1,7 @@
- hosts: mongodb - hosts: mongodb
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Get info - name: Get info

View File

@ -1,7 +1,7 @@
- hosts: mysql - hosts: mysql
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
check_ssl: "{{ jms_asset.spec_info.use_ssl and not jms_asset.spec_info.allow_invalid_cert }}" check_ssl: "{{ jms_asset.spec_info.use_ssl and not jms_asset.spec_info.allow_invalid_cert }}"
ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}"
ssl_cert: "{{ jms_asset.secret_info.client_cert | default('') }}" ssl_cert: "{{ jms_asset.secret_info.client_cert | default('') }}"

View File

@ -1,7 +1,7 @@
- hosts: oralce - hosts: oralce
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Get info - name: Get info

View File

@ -1,7 +1,7 @@
- hosts: postgresql - hosts: postgresql
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
check_ssl: "{{ jms_asset.spec_info.use_ssl }}" check_ssl: "{{ jms_asset.spec_info.use_ssl }}"
check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}" check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}"
ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}"

View File

@ -1,7 +1,7 @@
- hosts: sqlserver - hosts: sqlserver
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Test SQLServer connection - name: Test SQLServer connection

View File

@ -1,7 +1,7 @@
- hosts: mongodb - hosts: mongodb
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Test MongoDB connection - name: Test MongoDB connection

View File

@ -1,7 +1,7 @@
- hosts: mysql - hosts: mysql
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
db_name: "{{ jms_asset.spec_info.db_name }}" db_name: "{{ jms_asset.spec_info.db_name }}"
check_ssl: "{{ jms_asset.spec_info.use_ssl and not jms_asset.spec_info.allow_invalid_cert }}" check_ssl: "{{ jms_asset.spec_info.use_ssl and not jms_asset.spec_info.allow_invalid_cert }}"
ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}"

View File

@ -1,7 +1,7 @@
- hosts: oracle - hosts: oracle
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Test Oracle connection - name: Test Oracle connection

View File

@ -1,7 +1,7 @@
- hosts: postgre - hosts: postgre
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
check_ssl: "{{ jms_asset.spec_info.use_ssl }}" check_ssl: "{{ jms_asset.spec_info.use_ssl }}"
check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}" check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}"
ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}"

View File

@ -1,7 +1,7 @@
- hosts: sqlserver - hosts: sqlserver
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Test SQLServer connection - name: Test SQLServer connection

View File

@ -9,7 +9,8 @@
database: passwd database: passwd
key: "{{ account.username }}" key: "{{ account.username }}"
register: user_info register: user_info
ignore_errors: yes # 忽略错误如果用户不存在时不会导致playbook失败 failed_when: false
changed_when: false
- name: "Add {{ account.username }} user" - name: "Add {{ account.username }} user"
ansible.builtin.user: ansible.builtin.user:
@ -18,10 +19,10 @@
shell: "{{ params.shell if params.shell | length > 0 else omit }}" shell: "{{ params.shell if params.shell | length > 0 else omit }}"
home: "{{ params.home if params.home | length > 0 else '/home/' + account.username }}" home: "{{ params.home if params.home | length > 0 else '/home/' + account.username }}"
groups: "{{ params.groups if params.groups | length > 0 else omit }}" groups: "{{ params.groups if params.groups | length > 0 else omit }}"
append: yes append: "{{ true if params.groups | length > 0 else false }}"
expires: -1 expires: -1
state: present state: present
when: user_info.failed when: user_info.msg is defined
- name: "Set {{ account.username }} sudo setting" - name: "Set {{ account.username }} sudo setting"
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
@ -31,7 +32,7 @@
line: "{{ account.username + ' ALL=(ALL) NOPASSWD: ' + params.sudo }}" line: "{{ account.username + ' ALL=(ALL) NOPASSWD: ' + params.sudo }}"
validate: visudo -cf %s validate: visudo -cf %s
when: when:
- user_info.failed or params.modify_sudo - user_info.msg is defined or params.modify_sudo
- params.sudo - params.sudo
- name: "Change {{ account.username }} password" - name: "Change {{ account.username }} password"

View File

@ -9,7 +9,8 @@
database: passwd database: passwd
key: "{{ account.username }}" key: "{{ account.username }}"
register: user_info register: user_info
ignore_errors: yes # 忽略错误如果用户不存在时不会导致playbook失败 failed_when: false
changed_when: false
- name: "Add {{ account.username }} user" - name: "Add {{ account.username }} user"
ansible.builtin.user: ansible.builtin.user:
@ -18,10 +19,10 @@
shell: "{{ params.shell if params.shell | length > 0 else omit }}" shell: "{{ params.shell if params.shell | length > 0 else omit }}"
home: "{{ params.home if params.home | length > 0 else '/home/' + account.username }}" home: "{{ params.home if params.home | length > 0 else '/home/' + account.username }}"
groups: "{{ params.groups if params.groups | length > 0 else omit }}" groups: "{{ params.groups if params.groups | length > 0 else omit }}"
append: yes append: "{{ true if params.groups | length > 0 else false }}"
expires: -1 expires: -1
state: present state: present
when: user_info.failed when: user_info.msg is defined
- name: "Set {{ account.username }} sudo setting" - name: "Set {{ account.username }} sudo setting"
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
@ -31,7 +32,7 @@
line: "{{ account.username + ' ALL=(ALL) NOPASSWD: ' + params.sudo }}" line: "{{ account.username + ' ALL=(ALL) NOPASSWD: ' + params.sudo }}"
validate: visudo -cf %s validate: visudo -cf %s
when: when:
- user_info.failed or params.modify_sudo - user_info.msg is defined or params.modify_sudo
- params.sudo - params.sudo
- name: "Change {{ account.username }} password" - name: "Change {{ account.username }} password"

View File

@ -1,7 +1,7 @@
- hosts: mongodb - hosts: mongodb
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: "Remove account" - name: "Remove account"

View File

@ -1,7 +1,7 @@
- hosts: mysql - hosts: mysql
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
check_ssl: "{{ jms_asset.spec_info.use_ssl and not jms_asset.spec_info.allow_invalid_cert }}" check_ssl: "{{ jms_asset.spec_info.use_ssl and not jms_asset.spec_info.allow_invalid_cert }}"
ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}"
ssl_cert: "{{ jms_asset.secret_info.client_cert | default('') }}" ssl_cert: "{{ jms_asset.secret_info.client_cert | default('') }}"

View File

@ -1,7 +1,7 @@
- hosts: oracle - hosts: oracle
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: "Remove account" - name: "Remove account"

View File

@ -1,7 +1,7 @@
- hosts: postgresql - hosts: postgresql
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
check_ssl: "{{ jms_asset.spec_info.use_ssl }}" check_ssl: "{{ jms_asset.spec_info.use_ssl }}"
check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}" check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}"
ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}"

View File

@ -1,7 +1,7 @@
- hosts: sqlserver - hosts: sqlserver
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: "Remove account" - name: "Remove account"

View File

@ -1,7 +1,7 @@
- hosts: mongodb - hosts: mongodb
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Verify account - name: Verify account

View File

@ -1,7 +1,7 @@
- hosts: mysql - hosts: mysql
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
check_ssl: "{{ jms_asset.spec_info.use_ssl and not jms_asset.spec_info.allow_invalid_cert }}" check_ssl: "{{ jms_asset.spec_info.use_ssl and not jms_asset.spec_info.allow_invalid_cert }}"
ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}"
ssl_cert: "{{ jms_asset.secret_info.client_cert | default('') }}" ssl_cert: "{{ jms_asset.secret_info.client_cert | default('') }}"

View File

@ -1,7 +1,7 @@
- hosts: oracle - hosts: oracle
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Verify account - name: Verify account

View File

@ -1,7 +1,7 @@
- hosts: postgresql - hosts: postgresql
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
check_ssl: "{{ jms_asset.spec_info.use_ssl }}" check_ssl: "{{ jms_asset.spec_info.use_ssl }}"
check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}" check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}"
ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}"

View File

@ -1,7 +1,7 @@
- hosts: sqlserver - hosts: sqlserver
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Verify account - name: Verify account

View File

@ -1,7 +1,7 @@
- hosts: mongodb - hosts: mongodb
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Get info - name: Get info

View File

@ -1,7 +1,7 @@
- hosts: mysql - hosts: mysql
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
check_ssl: "{{ jms_asset.spec_info.use_ssl and not jms_asset.spec_info.allow_invalid_cert }}" check_ssl: "{{ jms_asset.spec_info.use_ssl and not jms_asset.spec_info.allow_invalid_cert }}"
ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}"
ssl_cert: "{{ jms_asset.secret_info.client_cert | default('') }}" ssl_cert: "{{ jms_asset.secret_info.client_cert | default('') }}"

View File

@ -1,7 +1,7 @@
- hosts: oracle - hosts: oracle
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Get info - name: Get info

View File

@ -1,7 +1,7 @@
- hosts: postgresql - hosts: postgresql
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
check_ssl: "{{ jms_asset.spec_info.use_ssl }}" check_ssl: "{{ jms_asset.spec_info.use_ssl }}"
check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}" check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}"
ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}"

View File

@ -1,7 +1,7 @@
- hosts: mongodb - hosts: mongodb
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Test MongoDB connection - name: Test MongoDB connection

View File

@ -1,7 +1,7 @@
- hosts: mysql - hosts: mysql
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
check_ssl: "{{ jms_asset.spec_info.use_ssl and not jms_asset.spec_info.allow_invalid_cert }}" check_ssl: "{{ jms_asset.spec_info.use_ssl and not jms_asset.spec_info.allow_invalid_cert }}"
ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}"
ssl_cert: "{{ jms_asset.secret_info.client_cert | default('') }}" ssl_cert: "{{ jms_asset.secret_info.client_cert | default('') }}"

View File

@ -1,7 +1,7 @@
- hosts: oracle - hosts: oracle
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Test Oracle connection - name: Test Oracle connection

View File

@ -1,7 +1,7 @@
- hosts: postgre - hosts: postgre
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
check_ssl: "{{ jms_asset.spec_info.use_ssl }}" check_ssl: "{{ jms_asset.spec_info.use_ssl }}"
check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}" check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}"
ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}"

View File

@ -1,7 +1,7 @@
- hosts: sqlserver - hosts: sqlserver
gather_facts: no gather_facts: no
vars: vars:
ansible_python_interpreter: /opt/py3/bin/python ansible_python_interpreter: "{{ local_python_interpreter }}"
tasks: tasks:
- name: Test SQLServer connection - name: Test SQLServer connection

View File

@ -1466,5 +1466,6 @@
"AccountResult": "Account Success/Failure", "AccountResult": "Account Success/Failure",
"ResetSecret": "Reset secret", "ResetSecret": "Reset secret",
"Connectable": "Connectable", "Connectable": "Connectable",
"AccountRecord": "Account record" "RecordList": "Records",
"Documentation": "Documentation"
} }

View File

@ -1424,7 +1424,6 @@
"RecentlyChangedPassword": "最近改密", "RecentlyChangedPassword": "最近改密",
"RecentPasswordChangeFailed": "最近改密失败", "RecentPasswordChangeFailed": "最近改密失败",
"RiskyAccount": "风险账号", "RiskyAccount": "风险账号",
"RiskDetection": "风险检测",
"LongTimeNoLogin": "长期未登录账号", "LongTimeNoLogin": "长期未登录账号",
"UnmanagedAccount": "未托管账号", "UnmanagedAccount": "未托管账号",
"UnavailableAccount": "不可用账号", "UnavailableAccount": "不可用账号",
@ -1459,7 +1458,6 @@
"ProportionOfAccountTypes": "账号类型占比", "ProportionOfAccountTypes": "账号类型占比",
"CurrentStatus": "当前状态", "CurrentStatus": "当前状态",
"ChangeSecretTaskStatus": "改密任务执行状态", "ChangeSecretTaskStatus": "改密任务执行状态",
"ChangeSecret": "账号改密",
"MenuChangeSecret": "账号改密", "MenuChangeSecret": "账号改密",
"TaskCount": "任务数", "TaskCount": "任务数",
"ScheduledTaskCount": "定时任务数", "ScheduledTaskCount": "定时任务数",
@ -1471,10 +1469,11 @@
"AccountResult": "账号成功/失败情况", "AccountResult": "账号成功/失败情况",
"ResetSecret": "可改密", "ResetSecret": "可改密",
"Connectable": "可连接", "Connectable": "可连接",
"AccountRecord": "账号记录", "RecordList": "记录",
"RiskDetection": "风险检测", "RiskDetection": "风险检测",
"DetectResults": "检测结果", "DetectResults": "检测结果",
"DetectTasks": "检测任务", "DetectTasks": "检测任务",
"DetectEngines": "检测引擎", "DetectEngines": "检测引擎",
"ChangeSecret": "账号改密" "ChangeSecret": "账号改密",
"Documentation": "文档"
} }

View File

@ -2,6 +2,7 @@
import json import json
import os import os
import re import re
import sys
from collections import defaultdict from collections import defaultdict
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
@ -191,6 +192,7 @@ class JMSInventory:
secret_info = {k: v for k, v in asset.secret_info.items() if v} secret_info = {k: v for k, v in asset.secret_info.items() if v}
host = { host = {
'name': name, 'name': name,
'local_python_interpreter': sys.executable,
'jms_asset': { 'jms_asset': {
'id': str(asset.id), 'name': asset.name, 'address': asset.address, 'id': str(asset.id), 'name': asset.name, 'address': asset.address,
'type': tp, 'category': category, 'type': tp, 'category': category,