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

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",
  }
}
主站蜘蛛池模板: 卓资县| 灵璧县| 沿河| 肃南| 白银市| 大荔县| 冷水江市| 金坛市| 马边| 上林县| 连山| 剑阁县| 五河县| 长白| 兰考县| 贵德县| 林口县| 自治县| 固原市| 苏尼特左旗| 贡嘎县| 锡林浩特市| 溆浦县| 靖远县| 波密县| 泰顺县| 郑州市| 高邮市| 五台县| 中阳县| 奈曼旗| 深水埗区| 图木舒克市| 揭东县| 大足县| 宁乡县| 阳江市| 宁远县| 肇州县| 连山| 万全县|