盐栈:创建具有相同名称的用户和组

Salt stack: Create user and group with same name

我正在尝试在多个 linux 具有相同名称 nagios 的服务器上创建用户和组。

我有这段代码:

nagios:
  group:
    - present
  user:
    - present
    - fullname: Nagios System Monitoring
    - shell: /bin/bash
    - home: /opt/nagios

组已正确创建,但用户未正确创建,我无法得到 salt 来告诉我原因。

来自文档 http://docs.saltstack.com/en/latest/ref/states/all/salt.states.user.html

user.present:
  - gid_from_name
    If True, the default group id will be set to the 
    id of the group with the same name as the user, Default is False.

此外,一般来说,您可以通过 ssh 进入目标 minion 并通过 salt-call 运行 状态获得更好的调试输出,有或没有 -l debug