mirror of https://github.com/jumpserver/jumpserver
fit2bot
1 year ago
committed by
GitHub
5 changed files with 119 additions and 1 deletions
@ -0,0 +1,35 @@
|
||||
- hosts: demo |
||||
gather_facts: no |
||||
tasks: |
||||
- name: Test privileged account |
||||
ansible.windows.win_ping: |
||||
|
||||
# - name: Print variables |
||||
# debug: |
||||
# msg: "Username: {{ account.username }}, Password: {{ account.secret }}" |
||||
|
||||
- name: Change password |
||||
ansible.windows.win_user: |
||||
fullname: "{{ account.username}}" |
||||
name: "{{ account.username }}" |
||||
password: "{{ account.secret }}" |
||||
password_never_expires: yes |
||||
groups: "{{ params.groups }}" |
||||
groups_action: add |
||||
update_password: always |
||||
ignore_errors: true |
||||
when: account.secret_type == "password" |
||||
|
||||
- name: Refresh connection |
||||
ansible.builtin.meta: reset_connection |
||||
|
||||
- name: Verify password (pyfreerdp) |
||||
rdp_ping: |
||||
login_host: "{{ jms_asset.address }}" |
||||
login_port: "{{ jms_asset.protocols | selectattr('name', 'equalto', 'rdp') | map(attribute='port') | first }}" |
||||
login_user: "{{ account.username }}" |
||||
login_password: "{{ account.secret }}" |
||||
login_secret_type: "{{ account.secret_type }}" |
||||
login_private_key_path: "{{ account.private_key_path }}" |
||||
when: account.secret_type == "password" |
||||
delegate_to: localhost |
@ -0,0 +1,26 @@
|
||||
id: change_secret_windows_rdp_verify |
||||
name: "{{ 'Windows account change secret rdp verify' | trans }}" |
||||
version: 1 |
||||
method: change_secret |
||||
category: host |
||||
type: |
||||
- windows |
||||
params: |
||||
- name: groups |
||||
type: str |
||||
label: '用户组' |
||||
default: 'Users,Remote Desktop Users' |
||||
help_text: "{{ 'Params groups help text' | trans }}" |
||||
|
||||
|
||||
i18n: |
||||
Windows account change secret rdp verify: |
||||
zh: '使用 Ansible 模块 win_user 执行 Windows 账号改密 RDP 协议测试最后的可连接性' |
||||
ja: 'Ansibleモジュールwin_userはWindowsアカウントの改密RDPプロトコルテストの最後の接続性を実行する' |
||||
en: 'Using the Ansible module win_user performs Windows account encryption RDP protocol testing for final connectivity' |
||||
|
||||
Params groups help text: |
||||
zh: '请输入用户组,多个用户组使用逗号分隔(需填写已存在的用户组)' |
||||
ja: 'グループを入力してください。複数のグループはコンマで区切ってください(既存のグループを入力してください)' |
||||
en: 'Please enter the group. Multiple groups are separated by commas (please enter the existing group)' |
||||
|
@ -0,0 +1,35 @@
|
||||
- hosts: demo |
||||
gather_facts: no |
||||
tasks: |
||||
- name: Test privileged account |
||||
ansible.windows.win_ping: |
||||
|
||||
# - name: Print variables |
||||
# debug: |
||||
# msg: "Username: {{ account.username }}, Password: {{ account.secret }}" |
||||
|
||||
- name: Push user password |
||||
ansible.windows.win_user: |
||||
fullname: "{{ account.username}}" |
||||
name: "{{ account.username }}" |
||||
password: "{{ account.secret }}" |
||||
password_never_expires: yes |
||||
groups: "{{ params.groups }}" |
||||
groups_action: add |
||||
update_password: always |
||||
ignore_errors: true |
||||
when: account.secret_type == "password" |
||||
|
||||
- name: Refresh connection |
||||
ansible.builtin.meta: reset_connection |
||||
|
||||
- name: Verify password (pyfreerdp) |
||||
rdp_ping: |
||||
login_host: "{{ jms_asset.address }}" |
||||
login_port: "{{ jms_asset.protocols | selectattr('name', 'equalto', 'rdp') | map(attribute='port') | first }}" |
||||
login_user: "{{ account.username }}" |
||||
login_password: "{{ account.secret }}" |
||||
login_secret_type: "{{ account.secret_type }}" |
||||
login_private_key_path: "{{ account.private_key_path }}" |
||||
when: account.secret_type == "password" |
||||
delegate_to: localhost |
@ -0,0 +1,19 @@
|
||||
id: push_account_windows_rdp_verify |
||||
name: "{{ 'Windows account push rdp verify' | trans }}" |
||||
version: 1 |
||||
method: push_account |
||||
category: host |
||||
type: |
||||
- windows |
||||
params: |
||||
- name: groups |
||||
type: str |
||||
label: '用户组' |
||||
default: 'Users,Remote Desktop Users' |
||||
help_text: '请输入用户组,多个用户组使用逗号分隔(需填写已存在的用户组)' |
||||
|
||||
i18n: |
||||
Windows account push rdp verify: |
||||
zh: 使用 Ansible 模块 win_user 执行 Windows 账号推送 RDP 协议测试最后的可连接性 |
||||
ja: Ansibleモジュールwin_userがWindowsアカウントプッシュRDPプロトコルテストを実行する最後の接続性 |
||||
en: Using the Ansible module win_user performs Windows account push RDP protocol testing for final connectivity |
Loading…
Reference in new issue