【问题标题】:Create windows user with chef and add user to the local Administrators group使用 chef 创建 windows 用户并将用户添加到本地管理员组
【发布时间】:2014-08-09 05:32:54
【问题描述】:

用户资源的厨师文档:http://docs.getchef.com/resource_user.html

这样做很有效:

user "TestUser" do
  password "p@ssw0rd"
end

但是当我添加一个 gid 时它失败了:

user "TestUser" do
  password "p@ssw0rd"
  gid "Administrators"
end

我也尝试过传递 .\Administrator,但得到相同的结果:

[2014-08-08T14:00:11-07:00] FATAL: ArgumentError: user[TestUser] (test::users line 11) had an error: ArgumentError: The user does not belong to this group.

gid 的目的不是指定组成员吗?

【问题讨论】:

    标签: ruby windows chef-infra


    【解决方案1】:

    终于想通了。诀窍是像这样修改组:

    user "TestUser" do
      password "p@ssw0rd"
    end
    
    group "Administrators" do
      action :modify
      members "TestUser"
      append true
    end
    

    【讨论】:

      猜你喜欢
      • 2017-09-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-03
      相关资源
      最近更新 更多