我想创建一个带有干净主目录的用户,但在使用用户模块时,我默认获得文件.bashrc
,.bash_logout
和.profile
(这些是默认值为/etc/skel/
)
如何在没有它们的情况下创建用户?
剧本的相关部分:
- name: Create user
become: true
user:
name: johndoe
state: present
shell: /bin/bash
system: no
createhome: yes
home: /data/johndoe
答案 0 :(得分:2)
您必须将skeleton
设置为false
(或no
),如下所示:
- name: Create user
become: true
user:
name: johndoe
state: present
shell: /bin/bash
system: no
createhome: yes
home: /data/johndoe
skeleton: false # <- add this line