소스 검색

current

master
부모
커밋
bb4a80c93f
1개의 변경된 파일22개의 추가작업 그리고 1개의 파일을 삭제
  1. +22
    -1
      tasks/main.yml

+ 22
- 1
tasks/main.yml 파일 보기

@@ -12,14 +12,17 @@
user:
name: "{{ item.key }}"
group: "{{ item.key }}"
groups: "{{ item.value.groups | join(',') }}"
uid: "{{ item.value.uid }}"
password: "{{ item.value.password }}"
home: "{{ item.value.home | default('/home/'+item.key) }}"
shell: "{{ item.value.shell | default('/bin/bash') }}"
generate_ssh_key: yes
ssh_key_type: ed25519
state: present
with_dict: "{{ users }}"

- name: home directory permissions
- name: home directory
file:
path: "{{ item.value.home | default('/home/'+item.key) }}"
owner: "{{ item.key }}"
@@ -27,3 +30,21 @@
mode: "{{ item.homedir_mode | default(700) }}"
state: directory
with_dict: "{{ users }}"

- name: ssh directory
file:
path: "{{ item.value.home | default('/home/'+item.key) }}/.ssh"
owner: "{{ item.key }}"
group: "{{ item.key }}"
mode: "700"
state: directory
with_dict: "{{ users }}"

- name: ssh authorized keys
copy:
content: "{{ item.authorized_keys }}"
dest: "{{ item.value.home | default('/home/'+item.key) }}/.ssh/authorized_keys"
owner: "{{ item.key }}"
group: "{{ item.key }}"
with_dict: "{{ users }}"
when: item.authorized_keys is defined

불러오는 중...
취소
저장