mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-06 03:26:33 +00:00
perf: 添加监测密码的脚本
This commit is contained in:
parent
09494193ab
commit
02d3747c70
1
utils/playbooks/change_password/hosts
Normal file
1
utils/playbooks/change_password/hosts
Normal file
@ -0,0 +1 @@
|
||||
testhost ansible_host=192.168.244.207
|
23
utils/playbooks/change_password/main.yml
Normal file
23
utils/playbooks/change_password/main.yml
Normal file
@ -0,0 +1,23 @@
|
||||
- hosts: testhost
|
||||
vars:
|
||||
ansible_user: root
|
||||
ansible_ssh_password: Fit2Cloud20202
|
||||
user1: web
|
||||
user1password: Fit2Cloud@12344
|
||||
|
||||
tasks:
|
||||
- name: 监测特权用户密码
|
||||
ping:
|
||||
|
||||
- name: 更改用户密码
|
||||
user:
|
||||
name: "{{ user1 }}"
|
||||
password: "{{ user1password|password_hash('sha512', 'K3mIlKK') }}"
|
||||
update_password: always
|
||||
|
||||
- name: 校验密码是否更改成功
|
||||
vars:
|
||||
- ansible_user: '{{ user1 }}'
|
||||
ansible_ssh_password: '{{ user1password }}'
|
||||
ping:
|
||||
|
3
utils/playbooks/change_password/start.sh
Executable file
3
utils/playbooks/change_password/start.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
ansible-playbook -i hosts main.yml
|
Loading…
Reference in New Issue
Block a user