官术网_书友最值得收藏!

Adding users

We will need a recipe to manage our users; here, we will use the users cookbook. We will create one user, webuser, which will be the account that is used for deployment and user connectivity. We will define our user in a JSON file similar to what we did in the previous chapter; place the following in a users/webuser.json file:

{
  "id" : "webuser",
  "uid" : "1000",
  "gid" : 1000,
  "shell" : "/bin/bash",
  "comment" : "Webapp deployment user",
  "groups" : ["webusers"]
}

Then, you can load this user using the from file command:

knife data bag from file users users

Ensure that your hosts have our new users by editing the base_server role and adding our webusers group so that any users in that group will be provisioned on all our servers that incorporate the base_server role:

{
  "shell_users": {
    "group": "webusers",
  }
}
主站蜘蛛池模板: 柯坪县| 县级市| 云安县| 关岭| 中宁县| 石景山区| 通道| 隆回县| 太湖县| 修水县| 南汇区| 吴江市| 灵寿县| 阿拉善左旗| 澜沧| 桐柏县| 道孚县| 进贤县| 兴隆县| 灌阳县| 清涧县| 东阿县| 盈江县| 临沭县| 茂名市| 焉耆| 青河县| 济宁市| 额济纳旗| 呼伦贝尔市| 阳春市| 佛学| 定远县| 沙洋县| 洪湖市| 桂东县| 宜昌市| 沂南县| 富民县| 曲松县| 扶风县|