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

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",
  }
}
主站蜘蛛池模板: 隆德县| 江油市| 高淳县| 丰原市| 平阳县| 农安县| 涟水县| 宁夏| 蓬莱市| 武汉市| 呼图壁县| 凤阳县| 崇仁县| 广东省| 吴川市| 普兰县| 若羌县| 鄯善县| 山阴县| 乌拉特后旗| 汕尾市| 淄博市| 泗阳县| 苍梧县| 忻城县| 青川县| 奉节县| 大同县| 揭东县| 南昌县| 晋州市| 林甸县| 湖州市| 遵义市| 诸城市| 周口市| 公安县| 星座| 沂源县| 静海县| 阜阳市|