diff --git a/apps/accounts/automations/change_secret/database/mongodb/main.yml b/apps/accounts/automations/change_secret/database/mongodb/main.yml index 0c4240b37..36fb90579 100644 --- a/apps/accounts/automations/change_secret/database/mongodb/main.yml +++ b/apps/accounts/automations/change_secret/database/mongodb/main.yml @@ -1,7 +1,7 @@ - hosts: mongodb gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Test MongoDB connection diff --git a/apps/accounts/automations/change_secret/database/mysql/main.yml b/apps/accounts/automations/change_secret/database/mysql/main.yml index 2e4123882..20813687a 100644 --- a/apps/accounts/automations/change_secret/database/mysql/main.yml +++ b/apps/accounts/automations/change_secret/database/mysql/main.yml @@ -1,7 +1,7 @@ - hosts: mysql gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" 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 }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" diff --git a/apps/accounts/automations/change_secret/database/oracle/main.yml b/apps/accounts/automations/change_secret/database/oracle/main.yml index e881cdaa6..6b91b7a2b 100644 --- a/apps/accounts/automations/change_secret/database/oracle/main.yml +++ b/apps/accounts/automations/change_secret/database/oracle/main.yml @@ -1,7 +1,7 @@ - hosts: oracle gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Test Oracle connection diff --git a/apps/accounts/automations/change_secret/database/postgresql/main.yml b/apps/accounts/automations/change_secret/database/postgresql/main.yml index c15accca2..79e928b16 100644 --- a/apps/accounts/automations/change_secret/database/postgresql/main.yml +++ b/apps/accounts/automations/change_secret/database/postgresql/main.yml @@ -1,7 +1,7 @@ - hosts: postgre gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" check_ssl: "{{ jms_asset.spec_info.use_ssl }}" check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" diff --git a/apps/accounts/automations/change_secret/database/sqlserver/main.yml b/apps/accounts/automations/change_secret/database/sqlserver/main.yml index b223824b5..4e8cd5d52 100644 --- a/apps/accounts/automations/change_secret/database/sqlserver/main.yml +++ b/apps/accounts/automations/change_secret/database/sqlserver/main.yml @@ -1,7 +1,7 @@ - hosts: sqlserver gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Test SQLServer connection diff --git a/apps/accounts/automations/change_secret/host/aix/main.yml b/apps/accounts/automations/change_secret/host/aix/main.yml index 40e110ab7..984b9de8e 100644 --- a/apps/accounts/automations/change_secret/host/aix/main.yml +++ b/apps/accounts/automations/change_secret/host/aix/main.yml @@ -9,7 +9,8 @@ database: passwd key: "{{ account.username }}" register: user_info - ignore_errors: yes # 忽略错误,如果用户不存在时不会导致playbook失败 + failed_when: false + changed_when: false - name: "Add {{ account.username }} user" ansible.builtin.user: @@ -18,10 +19,10 @@ shell: "{{ params.shell if params.shell | length > 0 else omit }}" home: "{{ params.home if params.home | length > 0 else '/home/' + account.username }}" groups: "{{ params.groups if params.groups | length > 0 else omit }}" - append: yes + append: "{{ true if params.groups | length > 0 else false }}" expires: -1 state: present - when: user_info.failed + when: user_info.msg is defined - name: "Set {{ account.username }} sudo setting" ansible.builtin.lineinfile: @@ -31,7 +32,7 @@ line: "{{ account.username + ' ALL=(ALL) NOPASSWD: ' + params.sudo }}" validate: visudo -cf %s when: - - user_info.failed or params.modify_sudo + - user_info.msg is defined or params.modify_sudo - params.sudo - name: "Change {{ account.username }} password" diff --git a/apps/accounts/automations/change_secret/host/posix/main.yml b/apps/accounts/automations/change_secret/host/posix/main.yml index 5403f94ca..8b991307b 100644 --- a/apps/accounts/automations/change_secret/host/posix/main.yml +++ b/apps/accounts/automations/change_secret/host/posix/main.yml @@ -9,7 +9,8 @@ database: passwd key: "{{ account.username }}" register: user_info - ignore_errors: yes # 忽略错误,如果用户不存在时不会导致playbook失败 + failed_when: false + changed_when: false - name: "Add {{ account.username }} user" ansible.builtin.user: @@ -18,10 +19,10 @@ shell: "{{ params.shell if params.shell | length > 0 else omit }}" home: "{{ params.home if params.home | length > 0 else '/home/' + account.username }}" groups: "{{ params.groups if params.groups | length > 0 else omit }}" - append: yes + append: "{{ true if params.groups | length > 0 else false }}" expires: -1 state: present - when: user_info.failed + when: user_info.msg is defined - name: "Set {{ account.username }} sudo setting" ansible.builtin.lineinfile: @@ -31,7 +32,7 @@ line: "{{ account.username + ' ALL=(ALL) NOPASSWD: ' + params.sudo }}" validate: visudo -cf %s when: - - user_info.failed or params.modify_sudo + - user_info.msg is defined or params.modify_sudo - params.sudo - name: "Change {{ account.username }} password" diff --git a/apps/accounts/automations/gather_account/database/mongodb/main.yml b/apps/accounts/automations/gather_account/database/mongodb/main.yml index 0f50b3885..a82bcc617 100644 --- a/apps/accounts/automations/gather_account/database/mongodb/main.yml +++ b/apps/accounts/automations/gather_account/database/mongodb/main.yml @@ -1,7 +1,7 @@ - hosts: mongodb gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Get info diff --git a/apps/accounts/automations/gather_account/database/mysql/main.yml b/apps/accounts/automations/gather_account/database/mysql/main.yml index 92121189d..0252f788a 100644 --- a/apps/accounts/automations/gather_account/database/mysql/main.yml +++ b/apps/accounts/automations/gather_account/database/mysql/main.yml @@ -1,7 +1,7 @@ - hosts: mysql gather_facts: no 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 }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ssl_cert: "{{ jms_asset.secret_info.client_cert | default('') }}" diff --git a/apps/accounts/automations/gather_account/database/oracle/main.yml b/apps/accounts/automations/gather_account/database/oracle/main.yml index 37d381f7d..dc2b5a701 100644 --- a/apps/accounts/automations/gather_account/database/oracle/main.yml +++ b/apps/accounts/automations/gather_account/database/oracle/main.yml @@ -1,7 +1,7 @@ - hosts: oralce gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Get info diff --git a/apps/accounts/automations/gather_account/database/postgresql/main.yml b/apps/accounts/automations/gather_account/database/postgresql/main.yml index fd27ab132..3408b06b3 100644 --- a/apps/accounts/automations/gather_account/database/postgresql/main.yml +++ b/apps/accounts/automations/gather_account/database/postgresql/main.yml @@ -1,7 +1,7 @@ - hosts: postgresql gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" check_ssl: "{{ jms_asset.spec_info.use_ssl }}" check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" diff --git a/apps/accounts/automations/gather_account/database/sqlserver/main.yml b/apps/accounts/automations/gather_account/database/sqlserver/main.yml index 252f5095e..ce8a20e0d 100644 --- a/apps/accounts/automations/gather_account/database/sqlserver/main.yml +++ b/apps/accounts/automations/gather_account/database/sqlserver/main.yml @@ -1,7 +1,7 @@ - hosts: sqlserver gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Test SQLServer connection diff --git a/apps/accounts/automations/push_account/database/mongodb/main.yml b/apps/accounts/automations/push_account/database/mongodb/main.yml index 73c5707d1..c6fd84297 100644 --- a/apps/accounts/automations/push_account/database/mongodb/main.yml +++ b/apps/accounts/automations/push_account/database/mongodb/main.yml @@ -1,7 +1,7 @@ - hosts: mongodb gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Test MongoDB connection diff --git a/apps/accounts/automations/push_account/database/mysql/main.yml b/apps/accounts/automations/push_account/database/mysql/main.yml index 3ae597d42..6ce4e2bb6 100644 --- a/apps/accounts/automations/push_account/database/mysql/main.yml +++ b/apps/accounts/automations/push_account/database/mysql/main.yml @@ -1,7 +1,7 @@ - hosts: mysql gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" 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 }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" diff --git a/apps/accounts/automations/push_account/database/oracle/main.yml b/apps/accounts/automations/push_account/database/oracle/main.yml index e881cdaa6..6b91b7a2b 100644 --- a/apps/accounts/automations/push_account/database/oracle/main.yml +++ b/apps/accounts/automations/push_account/database/oracle/main.yml @@ -1,7 +1,7 @@ - hosts: oracle gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Test Oracle connection diff --git a/apps/accounts/automations/push_account/database/postgresql/main.yml b/apps/accounts/automations/push_account/database/postgresql/main.yml index e148c1193..403566134 100644 --- a/apps/accounts/automations/push_account/database/postgresql/main.yml +++ b/apps/accounts/automations/push_account/database/postgresql/main.yml @@ -1,7 +1,7 @@ - hosts: postgre gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" check_ssl: "{{ jms_asset.spec_info.use_ssl }}" check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" diff --git a/apps/accounts/automations/push_account/database/sqlserver/main.yml b/apps/accounts/automations/push_account/database/sqlserver/main.yml index 38418af22..bb66c559a 100644 --- a/apps/accounts/automations/push_account/database/sqlserver/main.yml +++ b/apps/accounts/automations/push_account/database/sqlserver/main.yml @@ -1,7 +1,7 @@ - hosts: sqlserver gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Test SQLServer connection diff --git a/apps/accounts/automations/push_account/host/aix/main.yml b/apps/accounts/automations/push_account/host/aix/main.yml index b7e822489..92c8a5658 100644 --- a/apps/accounts/automations/push_account/host/aix/main.yml +++ b/apps/accounts/automations/push_account/host/aix/main.yml @@ -9,7 +9,8 @@ database: passwd key: "{{ account.username }}" register: user_info - ignore_errors: yes # 忽略错误,如果用户不存在时不会导致playbook失败 + failed_when: false + changed_when: false - name: "Add {{ account.username }} user" ansible.builtin.user: @@ -18,10 +19,10 @@ shell: "{{ params.shell if params.shell | length > 0 else omit }}" home: "{{ params.home if params.home | length > 0 else '/home/' + account.username }}" groups: "{{ params.groups if params.groups | length > 0 else omit }}" - append: yes + append: "{{ true if params.groups | length > 0 else false }}" expires: -1 state: present - when: user_info.failed + when: user_info.msg is defined - name: "Set {{ account.username }} sudo setting" ansible.builtin.lineinfile: @@ -31,7 +32,7 @@ line: "{{ account.username + ' ALL=(ALL) NOPASSWD: ' + params.sudo }}" validate: visudo -cf %s when: - - user_info.failed or params.modify_sudo + - user_info.msg is defined or params.modify_sudo - params.sudo - name: "Change {{ account.username }} password" diff --git a/apps/accounts/automations/push_account/host/posix/main.yml b/apps/accounts/automations/push_account/host/posix/main.yml index 577ccf4de..b47e6745e 100644 --- a/apps/accounts/automations/push_account/host/posix/main.yml +++ b/apps/accounts/automations/push_account/host/posix/main.yml @@ -9,7 +9,8 @@ database: passwd key: "{{ account.username }}" register: user_info - ignore_errors: yes # 忽略错误,如果用户不存在时不会导致playbook失败 + failed_when: false + changed_when: false - name: "Add {{ account.username }} user" ansible.builtin.user: @@ -18,10 +19,10 @@ shell: "{{ params.shell if params.shell | length > 0 else omit }}" home: "{{ params.home if params.home | length > 0 else '/home/' + account.username }}" groups: "{{ params.groups if params.groups | length > 0 else omit }}" - append: yes + append: "{{ true if params.groups | length > 0 else false }}" expires: -1 state: present - when: user_info.failed + when: user_info.msg is defined - name: "Set {{ account.username }} sudo setting" ansible.builtin.lineinfile: @@ -31,7 +32,7 @@ line: "{{ account.username + ' ALL=(ALL) NOPASSWD: ' + params.sudo }}" validate: visudo -cf %s when: - - user_info.failed or params.modify_sudo + - user_info.msg is defined or params.modify_sudo - params.sudo - name: "Change {{ account.username }} password" diff --git a/apps/accounts/automations/remove_account/database/mongodb/main.yml b/apps/accounts/automations/remove_account/database/mongodb/main.yml index 3ec800981..c4ef222e4 100644 --- a/apps/accounts/automations/remove_account/database/mongodb/main.yml +++ b/apps/accounts/automations/remove_account/database/mongodb/main.yml @@ -1,7 +1,7 @@ - hosts: mongodb gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: "Remove account" diff --git a/apps/accounts/automations/remove_account/database/mysql/main.yml b/apps/accounts/automations/remove_account/database/mysql/main.yml index 07b84a58b..d25ec0d94 100644 --- a/apps/accounts/automations/remove_account/database/mysql/main.yml +++ b/apps/accounts/automations/remove_account/database/mysql/main.yml @@ -1,7 +1,7 @@ - hosts: mysql gather_facts: no 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 }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ssl_cert: "{{ jms_asset.secret_info.client_cert | default('') }}" diff --git a/apps/accounts/automations/remove_account/database/oracle/main.yml b/apps/accounts/automations/remove_account/database/oracle/main.yml index ffd846d47..2e35dfd40 100644 --- a/apps/accounts/automations/remove_account/database/oracle/main.yml +++ b/apps/accounts/automations/remove_account/database/oracle/main.yml @@ -1,7 +1,7 @@ - hosts: oracle gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: "Remove account" diff --git a/apps/accounts/automations/remove_account/database/postgresql/main.yml b/apps/accounts/automations/remove_account/database/postgresql/main.yml index 4738fcd04..c47b747ec 100644 --- a/apps/accounts/automations/remove_account/database/postgresql/main.yml +++ b/apps/accounts/automations/remove_account/database/postgresql/main.yml @@ -1,7 +1,7 @@ - hosts: postgresql gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" check_ssl: "{{ jms_asset.spec_info.use_ssl }}" check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" diff --git a/apps/accounts/automations/remove_account/database/sqlserver/main.yml b/apps/accounts/automations/remove_account/database/sqlserver/main.yml index 597e12906..001879395 100644 --- a/apps/accounts/automations/remove_account/database/sqlserver/main.yml +++ b/apps/accounts/automations/remove_account/database/sqlserver/main.yml @@ -1,7 +1,7 @@ - hosts: sqlserver gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: "Remove account" diff --git a/apps/accounts/automations/verify_account/database/mongodb/main.yml b/apps/accounts/automations/verify_account/database/mongodb/main.yml index 13ecccb61..c50cbb1e5 100644 --- a/apps/accounts/automations/verify_account/database/mongodb/main.yml +++ b/apps/accounts/automations/verify_account/database/mongodb/main.yml @@ -1,7 +1,7 @@ - hosts: mongodb gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Verify account diff --git a/apps/accounts/automations/verify_account/database/mysql/main.yml b/apps/accounts/automations/verify_account/database/mysql/main.yml index ab6a4d33b..783011976 100644 --- a/apps/accounts/automations/verify_account/database/mysql/main.yml +++ b/apps/accounts/automations/verify_account/database/mysql/main.yml @@ -1,7 +1,7 @@ - hosts: mysql gather_facts: no 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 }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ssl_cert: "{{ jms_asset.secret_info.client_cert | default('') }}" diff --git a/apps/accounts/automations/verify_account/database/oracle/main.yml b/apps/accounts/automations/verify_account/database/oracle/main.yml index aa61fd349..3f5653ae3 100644 --- a/apps/accounts/automations/verify_account/database/oracle/main.yml +++ b/apps/accounts/automations/verify_account/database/oracle/main.yml @@ -1,7 +1,7 @@ - hosts: oracle gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Verify account diff --git a/apps/accounts/automations/verify_account/database/postgresql/main.yml b/apps/accounts/automations/verify_account/database/postgresql/main.yml index 24fdd6cb6..e3d681759 100644 --- a/apps/accounts/automations/verify_account/database/postgresql/main.yml +++ b/apps/accounts/automations/verify_account/database/postgresql/main.yml @@ -1,7 +1,7 @@ - hosts: postgresql gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" check_ssl: "{{ jms_asset.spec_info.use_ssl }}" check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" diff --git a/apps/accounts/automations/verify_account/database/sqlserver/main.yml b/apps/accounts/automations/verify_account/database/sqlserver/main.yml index df9830132..0a0509656 100644 --- a/apps/accounts/automations/verify_account/database/sqlserver/main.yml +++ b/apps/accounts/automations/verify_account/database/sqlserver/main.yml @@ -1,7 +1,7 @@ - hosts: sqlserver gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Verify account diff --git a/apps/assets/automations/gather_facts/database/mongodb/main.yml b/apps/assets/automations/gather_facts/database/mongodb/main.yml index 48bba74d1..4a62567df 100644 --- a/apps/assets/automations/gather_facts/database/mongodb/main.yml +++ b/apps/assets/automations/gather_facts/database/mongodb/main.yml @@ -1,7 +1,7 @@ - hosts: mongodb gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Get info diff --git a/apps/assets/automations/gather_facts/database/mysql/main.yml b/apps/assets/automations/gather_facts/database/mysql/main.yml index 24d0acde4..fe64f798f 100644 --- a/apps/assets/automations/gather_facts/database/mysql/main.yml +++ b/apps/assets/automations/gather_facts/database/mysql/main.yml @@ -1,7 +1,7 @@ - hosts: mysql gather_facts: no 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 }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ssl_cert: "{{ jms_asset.secret_info.client_cert | default('') }}" diff --git a/apps/assets/automations/gather_facts/database/oracle/main.yml b/apps/assets/automations/gather_facts/database/oracle/main.yml index ad89e7b7a..fa3e0ff99 100644 --- a/apps/assets/automations/gather_facts/database/oracle/main.yml +++ b/apps/assets/automations/gather_facts/database/oracle/main.yml @@ -1,7 +1,7 @@ - hosts: oracle gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Get info diff --git a/apps/assets/automations/gather_facts/database/postgresql/main.yml b/apps/assets/automations/gather_facts/database/postgresql/main.yml index e7bea6002..613945aaf 100644 --- a/apps/assets/automations/gather_facts/database/postgresql/main.yml +++ b/apps/assets/automations/gather_facts/database/postgresql/main.yml @@ -1,7 +1,7 @@ - hosts: postgresql gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" check_ssl: "{{ jms_asset.spec_info.use_ssl }}" check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" diff --git a/apps/assets/automations/ping/database/mongodb/main.yml b/apps/assets/automations/ping/database/mongodb/main.yml index 5c3f6e0af..40e4a7d49 100644 --- a/apps/assets/automations/ping/database/mongodb/main.yml +++ b/apps/assets/automations/ping/database/mongodb/main.yml @@ -1,7 +1,7 @@ - hosts: mongodb gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Test MongoDB connection diff --git a/apps/assets/automations/ping/database/mysql/main.yml b/apps/assets/automations/ping/database/mysql/main.yml index 2a05ee2ab..8187ac39f 100644 --- a/apps/assets/automations/ping/database/mysql/main.yml +++ b/apps/assets/automations/ping/database/mysql/main.yml @@ -1,7 +1,7 @@ - hosts: mysql gather_facts: no 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 }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" ssl_cert: "{{ jms_asset.secret_info.client_cert | default('') }}" diff --git a/apps/assets/automations/ping/database/oracle/main.yml b/apps/assets/automations/ping/database/oracle/main.yml index 3cad226e8..f15f6e489 100644 --- a/apps/assets/automations/ping/database/oracle/main.yml +++ b/apps/assets/automations/ping/database/oracle/main.yml @@ -1,7 +1,7 @@ - hosts: oracle gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Test Oracle connection diff --git a/apps/assets/automations/ping/database/postgresql/main.yml b/apps/assets/automations/ping/database/postgresql/main.yml index 3b29340e0..4decb0aaa 100644 --- a/apps/assets/automations/ping/database/postgresql/main.yml +++ b/apps/assets/automations/ping/database/postgresql/main.yml @@ -1,7 +1,7 @@ - hosts: postgre gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" check_ssl: "{{ jms_asset.spec_info.use_ssl }}" check_ca: "{{ check_ssl and not jms_asset.spec_info.allow_invalid_cert }}" ca_cert: "{{ jms_asset.secret_info.ca_cert | default('') }}" diff --git a/apps/assets/automations/ping/database/sqlserver/main.yml b/apps/assets/automations/ping/database/sqlserver/main.yml index 4eb8fa077..7cac3199d 100644 --- a/apps/assets/automations/ping/database/sqlserver/main.yml +++ b/apps/assets/automations/ping/database/sqlserver/main.yml @@ -1,7 +1,7 @@ - hosts: sqlserver gather_facts: no vars: - ansible_python_interpreter: /opt/py3/bin/python + ansible_python_interpreter: "{{ local_python_interpreter }}" tasks: - name: Test SQLServer connection diff --git a/apps/i18n/lina/en.json b/apps/i18n/lina/en.json index 06bc20d98..04569bd62 100644 --- a/apps/i18n/lina/en.json +++ b/apps/i18n/lina/en.json @@ -1466,5 +1466,6 @@ "AccountResult": "Account Success/Failure", "ResetSecret": "Reset secret", "Connectable": "Connectable", - "AccountRecord": "Account record" + "RecordList": "Records", + "Documentation": "Documentation" } \ No newline at end of file diff --git a/apps/i18n/lina/zh.json b/apps/i18n/lina/zh.json index f0c414b4a..9ac5eb6c5 100644 --- a/apps/i18n/lina/zh.json +++ b/apps/i18n/lina/zh.json @@ -1424,7 +1424,6 @@ "RecentlyChangedPassword": "最近改密", "RecentPasswordChangeFailed": "最近改密失败", "RiskyAccount": "风险账号", - "RiskDetection": "风险检测", "LongTimeNoLogin": "长期未登录账号", "UnmanagedAccount": "未托管账号", "UnavailableAccount": "不可用账号", @@ -1459,7 +1458,6 @@ "ProportionOfAccountTypes": "账号类型占比", "CurrentStatus": "当前状态", "ChangeSecretTaskStatus": "改密任务执行状态", - "ChangeSecret": "账号改密", "MenuChangeSecret": "账号改密", "TaskCount": "任务数", "ScheduledTaskCount": "定时任务数", @@ -1471,10 +1469,11 @@ "AccountResult": "账号成功/失败情况", "ResetSecret": "可改密", "Connectable": "可连接", - "AccountRecord": "账号记录", + "RecordList": "记录", "RiskDetection": "风险检测", "DetectResults": "检测结果", "DetectTasks": "检测任务", "DetectEngines": "检测引擎", - "ChangeSecret": "账号改密" + "ChangeSecret": "账号改密", + "Documentation": "文档" } \ No newline at end of file diff --git a/apps/ops/ansible/inventory.py b/apps/ops/ansible/inventory.py index bb9cf2060..2a5153c5a 100644 --- a/apps/ops/ansible/inventory.py +++ b/apps/ops/ansible/inventory.py @@ -2,6 +2,7 @@ import json import os import re +import sys from collections import defaultdict 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} host = { 'name': name, + 'local_python_interpreter': sys.executable, 'jms_asset': { 'id': str(asset.id), 'name': asset.name, 'address': asset.address, 'type': tp, 'category': category,