perf: Ansible playbook

pull/14903/head
feng 2025-02-18 16:23:26 +08:00 committed by feng626
parent daea434ce6
commit 13e5a03312
39 changed files with 56 additions and 50 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

@ -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,