问题原文
原帖链接 · Hyperfocus · CC BY-SA 3.0
What is the cleanest way of doing this? Tried adding the user to the sudo group with the users module but Ansible reports it can't find the sudo group.
已采纳解答
原帖链接 · Hyperfocus · CC BY-SA 3.0
Instead of
- name: create a new user
user: name=user
state=present
groups="group1, group2"
password={{ password }}
comment="Comment"
I did
- name: create a new user
user: name=user
state=present
group=primary-group
groups="sudo"
password={{ password }}
comment="Comment"
And the user was added to the sudo group.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
