Загрузить файлы в «test-playbooks»
This commit is contained in:
17
test-playbooks/add_admins[1].yml
Normal file
17
test-playbooks/add_admins[1].yml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
become: yes
|
||||||
|
gather_facts: no
|
||||||
|
serial: 100
|
||||||
|
vars:
|
||||||
|
wheel: wheel
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- include_vars: users.yml
|
||||||
|
- name: add administrators on all servers
|
||||||
|
user: name={{item.user}} password={{item.password}} groups={{item.groups}}
|
||||||
|
with_items: '{{admins}}'
|
||||||
|
register: task
|
||||||
|
|
||||||
|
- include: tasks/collect_changed_hosts.yml
|
||||||
|
- include: tasks/disable_ssh_root.yml
|
||||||
13
test-playbooks/change_user_password[1].yml
Normal file
13
test-playbooks/change_user_password[1].yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
ignore_unreachable: yes
|
||||||
|
gather_facts: no
|
||||||
|
become: yes
|
||||||
|
serial: 1
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: change user password
|
||||||
|
user:
|
||||||
|
name:
|
||||||
|
password: ""
|
||||||
|
update_password: always
|
||||||
Reference in New Issue
Block a user