mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-07-08 12:02:51 +00:00
perf: update ad account push and test
This commit is contained in:
@@ -5,14 +5,14 @@
|
||||
ansible.windows.win_ping:
|
||||
|
||||
- name: Change password
|
||||
community.windows.win_domain_user:
|
||||
microsoft.ad.user:
|
||||
name: "{{ account.username }}"
|
||||
password: "{{ account.secret }}"
|
||||
update_password: always
|
||||
password_never_expires: yes
|
||||
state: present
|
||||
groups: "{{ params.groups }}"
|
||||
groups_action: add
|
||||
groups:
|
||||
add: "{{ params.groups }}"
|
||||
ignore_errors: true
|
||||
when: account.secret_type == "password"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
- name: Verify password (win_ping)
|
||||
ansible.windows.win_ping:
|
||||
vars:
|
||||
ansible_user: "{{ account.full_username }}"
|
||||
ansible_user: "{{ account.username }}"
|
||||
ansible_password: "{{ account.secret }}"
|
||||
when: account.secret_type == "password" and check_conn_after_change
|
||||
register: verify_winping
|
||||
@@ -43,4 +43,8 @@
|
||||
- verify_winping is not defined
|
||||
or (verify_winping.unreachable | default(false))
|
||||
or (verify_winping.failed | default(false))
|
||||
delegate_to: localhost
|
||||
vars:
|
||||
ansible_connection: local
|
||||
ansible_shell_type: sh
|
||||
ansible_python_interpreter: "{{ local_python_interpreter }}"
|
||||
delegate_to: 127.0.0.1
|
||||
|
||||
@@ -28,4 +28,7 @@
|
||||
login_secret_type: "{{ account.secret_type }}"
|
||||
gateway_args: "{{ jms_gateway | default({}) }}"
|
||||
when: account.secret_type == "password" and check_conn_after_change
|
||||
delegate_to: localhost
|
||||
vars:
|
||||
ansible_connection: local
|
||||
ansible_shell_type: sh
|
||||
ansible_python_interpreter: "{{ local_python_interpreter }}"
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
ansible.windows.win_ping:
|
||||
|
||||
- name: Push user password
|
||||
community.windows.win_domain_user:
|
||||
microsoft.ad.user:
|
||||
name: "{{ account.username }}"
|
||||
password: "{{ account.secret }}"
|
||||
update_password: always
|
||||
password_never_expires: yes
|
||||
state: present
|
||||
groups: "{{ params.groups }}"
|
||||
groups_action: add
|
||||
groups:
|
||||
add: "{{ params.groups }}"
|
||||
ignore_errors: true
|
||||
when: account.secret_type == "password"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
- name: Verify password (win_ping)
|
||||
ansible.windows.win_ping:
|
||||
vars:
|
||||
ansible_user: "{{ account.full_username }}"
|
||||
ansible_user: "{{ account.username }}"
|
||||
ansible_password: "{{ account.secret }}"
|
||||
when: account.secret_type == "password" and check_conn_after_change
|
||||
register: verify_winping
|
||||
@@ -43,4 +43,7 @@
|
||||
- verify_winping is not defined
|
||||
or (verify_winping.unreachable | default(false))
|
||||
or (verify_winping.failed | default(false))
|
||||
delegate_to: localhost
|
||||
vars:
|
||||
ansible_connection: local
|
||||
ansible_shell_type: sh
|
||||
ansible_python_interpreter: "{{ local_python_interpreter }}"
|
||||
|
||||
@@ -28,4 +28,7 @@
|
||||
login_secret_type: "{{ account.secret_type }}"
|
||||
gateway_args: "{{ jms_gateway | default({}) }}"
|
||||
when: account.secret_type == "password" and check_conn_after_change
|
||||
delegate_to: localhost
|
||||
vars:
|
||||
ansible_connection: local
|
||||
ansible_shell_type: sh
|
||||
ansible_python_interpreter: "{{ local_python_interpreter }}"
|
||||
|
||||
@@ -259,6 +259,7 @@ class PlaybookPrepareMixin:
|
||||
def write_cert_to_file(filename, content):
|
||||
with open(filename, "w") as f:
|
||||
f.write(content)
|
||||
os.chmod(filename, 0o600)
|
||||
return filename
|
||||
|
||||
def convert_cert_to_file(self, host, path_dir):
|
||||
|
||||
Reference in New Issue
Block a user