jumpserver/playbook/user_perm.yaml

18 lines
630 B
YAML
Raw Normal View History

2015-10-06 10:51:49 +00:00
- hosts: the_del_group
tasks:
- name: del user
user: name={{ item }} state=absent remove=yes
2015-10-07 12:14:07 +00:00
with_items: [ the_del_users ]
2015-10-06 10:51:49 +00:00
2015-10-04 13:50:29 +00:00
- hosts: the_new_group
tasks:
- name: add user
2015-10-06 10:51:49 +00:00
user: name={{ item }} state=present
2015-10-07 12:14:07 +00:00
with_items: [ the_new_users ]
2015-10-04 13:50:29 +00:00
- name: .ssh direcotory
2015-10-06 10:51:49 +00:00
file: name=/home/{{ item }}/.ssh mode=700 owner={{ item }} group={{ item }} state=directory
2015-10-07 12:14:07 +00:00
with_items: [ the_new_users ]
2015-10-04 13:50:29 +00:00
- name: set authorizied_file
2015-10-24 15:52:06 +00:00
copy: src=KEY_DIR/{{ item }}.pub dest=/home/{{ item }}/.ssh/authorizied_keys owner={{ item }} group={{ item }} mode=600
2015-10-07 12:14:07 +00:00
with_items: [ the_new_users ]