如何在Chef kitchen.yml中更改框名?

时间:2016-07-31 09:12:46

标签: vagrant chef test-kitchen

我已按以下方式创建了kitchen.yml

---
driver:
  name: vagrant
  customize:
    memory: 2048

driver_config:
  require_chef_omnibus: true
  use_vagrant_berkshelf_plugin: true

provisioner:
  name: chef_zero
  chef_omnibus_url: http://box-url/install.sh

platforms:
  - name: prod.abc.com
    driver:
      box_url: http://abc.box
    run_list:
      - role[new_role]

suites:
  - name: default

在上面的kitchen.yml中,我将机器的主机名称为default-prodabccom。但是,我希望主机名为prod.abc.com

我应该在kitchen.yml中做出哪些更改才能获得正确的名称?

2 个答案:

答案 0 :(得分:3)

来宾系统的主机名

要定义在VM内运行的操作系统的主机名(参见{ "expand": "projects", ================================================================================================================================================ ================================================================================================================================================ ================================================================================================================================================ "projects": [ ================================================================================================ ================================================================================================ ================================================================================================ { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/project/11001", "id": "11001", "name": "Precheck", "key": "PRECHECK", "issuetypes": [ { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/1", "id": "1", "name": "Bug", "description": "A problem which impairs or prevents the functions of the product.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/bug.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/2", "id": "2", "name": "New Feature", "description": "A new feature of the product, which has yet to be developed.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/newfeature.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/3", "id": "3", "name": "Task", "description": "A task that needs to be done.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/task.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/4", "id": "4", "name": "Improvement", "description": "An improvement or enhancement to an existing feature or task.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/improvement.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/5", "id": "5", "name": "Sub-task", "description": "The sub-task of the issue", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/subtask_alternate.png", "subtask": true }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/10001", "id": "10001", "name": "\u6d4b\u8bd5", "description": "\u6b64\u53d1\u5e03\u7c7b\u578b\u7528\u4e8e\u5728 Jira \u4e2d\u521b\u5efa Zephyr \u6d4b\u8bd5\u3002", "iconUrl": "http://xxx.xx.xx.xxx:48082/download/resources/com.thed.zephyr.je/images/icons/ico_zephyr_issuetype.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/10100", "id": "10100", "name": "Epic", "description": "Created by JIRA Agile - do not edit or delete. Issue type for a big user story that needs to be broken down.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/epic.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/10200", "id": "10200", "name": "Ticket Template(WBSGantt)", "description": "Ticket Template", "iconUrl": "http://xxx.xx.xx.xxx:48082/download/resources/jp.ricksoft.plugins.wbsgantt-for-jira:wbsgantt-resources/images/template-icon.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/10201", "id": "10201", "name": "Phase", "description": "Project Development Phase", "iconUrl": "http://xxx.xx.xx.xxx:48082/download/resources/jp.ricksoft.plugins.wbsgantt-for-jira:wbsgantt-resources/images/phase-icon.png", "subtask": false } ], "avatarUrls": { "24x24": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?size=small&pid=11001&avatarId=10011", "16x16": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?size=xsmall&pid=11001&avatarId=10011", "32x32": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?size=medium&pid=11001&avatarId=10011", "48x48": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?pid=11001&avatarId=10011" } }, ================================================================================================ ================================================================================================ ================================================================================================ { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/project/11200", "id": "11200", "name": "\u4e8b\u4ef6\u7ba1\u7406", "key": "SJGL", "issuetypes": [ { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/5", "id": "5", "name": "Sub-task", "description": "The sub-task of the issue", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/subtask_alternate.png", "subtask": true }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/2", "id": "2", "name": "New Feature", "description": "A new feature of the product, which has yet to be developed.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/newfeature.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/3", "id": "3", "name": "Task", "description": "A task that needs to be done.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/task.png", "subtask": false } ], "avatarUrls": { "24x24": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?size=small&pid=11200&avatarId=10011", "16x16": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?size=xsmall&pid=11200&avatarId=10011", "32x32": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?size=medium&pid=11200&avatarId=10011", "48x48": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?pid=11200&avatarId=10011" } }, ================================================================================================ ================================================================================================ ================================================================================================ { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/project/10201", "id": "10201", "name": "\u4ea7\u54c1\u5185\u90e8\u4ea4\u6d41", "key": "CP", "issuetypes": [ { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/1", "id": "1", "name": "Bug", "description": "A problem which impairs or prevents the functions of the product.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/bug.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/2", "id": "2", "name": "New Feature", "description": "A new feature of the product, which has yet to be developed.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/newfeature.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/3", "id": "3", "name": "Task", "description": "A task that needs to be done.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/task.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/4", "id": "4", "name": "Improvement", "description": "An improvement or enhancement to an existing feature or task.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/improvement.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/5", "id": "5", "name": "Sub-task", "description": "The sub-task of the issue", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/subtask_alternate.png", "subtask": true }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/10001", "id": "10001", "name": "\u6d4b\u8bd5", "description": "\u6b64\u53d1\u5e03\u7c7b\u578b\u7528\u4e8e\u5728 Jira \u4e2d\u521b\u5efa Zephyr \u6d4b\u8bd5\u3002", "iconUrl": "http://xxx.xx.xx.xxx:48082/download/resources/com.thed.zephyr.je/images/icons/ico_zephyr_issuetype.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/10100", "id": "10100", "name": "Epic", "description": "Created by JIRA Agile - do not edit or delete. Issue type for a big user story that needs to be broken down.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/epic.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/10200", "id": "10200", "name": "Ticket Template(WBSGantt)", "description": "Ticket Template", "iconUrl": "http://xxx.xx.xx.xxx:48082/download/resources/jp.ricksoft.plugins.wbsgantt-for-jira:wbsgantt-resources/images/template-icon.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/10201", "id": "10201", "name": "Phase", "description": "Project Development Phase", "iconUrl": "http://xxx.xx.xx.xxx:48082/download/resources/jp.ricksoft.plugins.wbsgantt-for-jira:wbsgantt-resources/images/phase-icon.png", "subtask": false } ], "avatarUrls": { "24x24": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?size=small&pid=10201&avatarId=10011", "16x16": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?size=xsmall&pid=10201&avatarId=10011", "32x32": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?size=medium&pid=10201&avatarId=10011", "48x48": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?pid=10201&avatarId=10011" } }, ================================================================================================ ================================================================================================ ================================================================================================ { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/project/11009", "id": "11009", "name": "\u4ea7\u54c1\u8bbe\u8ba1\u9700\u6c42", "key": "PD", "issuetypes": [ { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/1", "id": "1", "name": "Bug", "description": "A problem which impairs or prevents the functions of the product.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/bug.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/2", "id": "2", "name": "New Feature", "description": "A new feature of the product, which has yet to be developed.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/newfeature.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/3", "id": "3", "name": "Task", "description": "A task that needs to be done.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/task.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/4", "id": "4", "name": "Improvement", "description": "An improvement or enhancement to an existing feature or task.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/improvement.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/5", "id": "5", "name": "Sub-task", "description": "The sub-task of the issue", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/subtask_alternate.png", "subtask": true }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/10001", "id": "10001", "name": "\u6d4b\u8bd5", "description": "\u6b64\u53d1\u5e03\u7c7b\u578b\u7528\u4e8e\u5728 Jira \u4e2d\u521b\u5efa Zephyr \u6d4b\u8bd5\u3002", "iconUrl": "http://xxx.xx.xx.xxx:48082/download/resources/com.thed.zephyr.je/images/icons/ico_zephyr_issuetype.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/10100", "id": "10100", "name": "Epic", "description": "Created by JIRA Agile - do not edit or delete. Issue type for a big user story that needs to be broken down.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/epic.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/10200", "id": "10200", "name": "Ticket Template(WBSGantt)", "description": "Ticket Template", "iconUrl": "http://xxx.xx.xx.xxx:48082/download/resources/jp.ricksoft.plugins.wbsgantt-for-jira:wbsgantt-resources/images/template-icon.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/10201", "id": "10201", "name": "Phase", "description": "Project Development Phase", "iconUrl": "http://xxx.xx.xx.xxx:48082/download/resources/jp.ricksoft.plugins.wbsgantt-for-jira:wbsgantt-resources/images/phase-icon.png", "subtask": false } ], "avatarUrls": { "24x24": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?size=small&pid=11009&avatarId=10011", "16x16": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?size=xsmall&pid=11009&avatarId=10011", "32x32": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?size=medium&pid=11009&avatarId=10011", "48x48": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?pid=11009&avatarId=10011" } }, ================================================================================================ ================================================================================================ ================================================================================================ { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/project/10005", "id": "10005", "name": "\u7f3a\u9677\u7ba1\u7406\u5e73\u53f0", "key": "ZXQ", "issuetypes": [ { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/1", "id": "1", "name": "Bug", "description": "A problem which impairs or prevents the functions of the product.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/bug.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/2", "id": "2", "name": "New Feature", "description": "A new feature of the product, which has yet to be developed.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/newfeature.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/3", "id": "3", "name": "Task", "description": "A task that needs to be done.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/task.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/4", "id": "4", "name": "Improvement", "description": "An improvement or enhancement to an existing feature or task.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/improvement.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/5", "id": "5", "name": "Sub-task", "description": "The sub-task of the issue", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/subtask_alternate.png", "subtask": true }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/10001", "id": "10001", "name": "\u6d4b\u8bd5", "description": "\u6b64\u53d1\u5e03\u7c7b\u578b\u7528\u4e8e\u5728 Jira \u4e2d\u521b\u5efa Zephyr \u6d4b\u8bd5\u3002", "iconUrl": "http://xxx.xx.xx.xxx:48082/download/resources/com.thed.zephyr.je/images/icons/ico_zephyr_issuetype.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/10100", "id": "10100", "name": "Epic", "description": "Created by JIRA Agile - do not edit or delete. Issue type for a big user story that needs to be broken down.", "iconUrl": "http://xxx.xx.xx.xxx:48082/images/icons/issuetypes/epic.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/10200", "id": "10200", "name": "Ticket Template(WBSGantt)", "description": "Ticket Template", "iconUrl": "http://xxx.xx.xx.xxx:48082/download/resources/jp.ricksoft.plugins.wbsgantt-for-jira:wbsgantt-resources/images/template-icon.png", "subtask": false }, { "self": "http://xxx.xx.xx.xxx:48082/rest/api/2/issuetype/10201", "id": "10201", "name": "Phase", "description": "Project Development Phase", "iconUrl": "http://xxx.xx.xx.xxx:48082/download/resources/jp.ricksoft.plugins.wbsgantt-for-jira:wbsgantt-resources/images/phase-icon.png", "subtask": false } ], "avatarUrls": { "24x24": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?size=small&pid=10005&avatarId=10011", "16x16": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?size=xsmall&pid=10005&avatarId=10011", "32x32": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?size=medium&pid=10005&avatarId=10011", "48x48": "http://xxx.xx.xx.xxx:48082/secure/projectavatar?pid=10005&avatarId=10011" } } ] } ),请使用 kitchen-vagrant 驱动程序的vm_hostname选项:< / p>

/etc/hostname

测试厨房套件/平台的名称

要重命名platforms: - name: prod.abc.com driver_config: vm_hostname: prod.abc.com 中显示的套件 - 平台组合,您只能使用Converging <default-prodabccom> namesuite,即获取platform 。此名称为computed here in test-kitchen,例如,所有点都被剥离,不能简单地更改。

尽管如此,如果我理解你想改变这个名字:对我来说没什么意义。不要改变它。

VirtualBox中的VM名称

VM的名称(例如production-abccom)派生here in kitchen-vagrant,无法轻易更改。

答案 1 :(得分:1)

我发现了这个问题,因为我正在测试一些厨房启用的回购,每个回收都包含许多平台。例如

  1. elasticsearch
    • 的centos-6
    • 的centos-7
  2. 的java
    • 的centos-6
    • 的centos-7
  3. 你可以通过虚拟机为这些机器提供自己的ip,当它们像这样旋转时;

    planes = 4; rows = 5; cols = 6
    m3 = 0x7FFCC94027F0; m3[0] = 0x7FFCC9402750; m3[0][0] = 0x7FFCC9402850
    Plane 1:
     111 112 113 114 115 116
     121 122 123 124 125 126
     131 132 133 134 135 136
     141 142 143 144 145 146
     151 152 153 154 155 156
    
    Plane 2:
     211 212 213 214 215 216
     221 222 223 224 225 226
     231 232 233 234 235 236
     241 242 243 244 245 246
     251 252 253 254 255 256
    
    Plane 3:
     311 312 313 314 315 316
     321 322 323 324 325 326
     331 332 333 334 335 336
     341 342 343 344 345 346
     351 352 353 354 355 356
    
    Plane 4:
     411 412 413 414 415 416
     421 422 423 424 425 426
     431 432 433 434 435 436
     441 442 443 444 445 446
     451 452 453 454 455 456
    
    m3 = 0x0000000000000000
    planes = 3; rows = 4; cols = 10
    m3 = 0x7FFCC94027F0; m3[0] = 0x7FFCC9402750; m3[0][0] = 0x7FFCC9402840
    Plane 1:
     111 112 113 114 115 116 117 118 119 120
     121 122 123 124 125 126 127 128 129 130
     131 132 133 134 135 136 137 138 139 140
     141 142 143 144 145 146 147 148 149 150
    
    Plane 2:
     211 212 213 214 215 216 217 218 219 220
     221 222 223 224 225 226 227 228 229 230
     231 232 233 234 235 236 237 238 239 240
     241 242 243 244 245 246 247 248 249 250
    
    Plane 3:
     311 312 313 314 315 316 317 318 319 320
     321 322 323 324 325 326 327 328 329 330
     331 332 333 334 335 336 337 338 339 340
     341 342 343 344 345 346 347 348 349 350
    
    m3 = 0x0000000000000000
    planes = 4; rows = 3; cols = 7
    m3 = 0x7FFCC94027F0; m3[0] = 0x7FFCC9402750; m3[0][0] = 0x7FFCC9402840
    Plane 1:
     111 112 113 114 115 116 117
     121 122 123 124 125 126 127
     131 132 133 134 135 136 137
    
    Plane 2:
     211 212 213 214 215 216 217
     221 222 223 224 225 226 227
     231 232 233 234 235 236 237
    
    Plane 3:
     311 312 313 314 315 316 317
     321 322 323 324 325 326 327
     331 332 333 334 335 336 337
    
    Plane 4:
     411 412 413 414 415 416 417
     421 422 423 424 425 426 427
     431 432 433 434 435 436 437
    
    m3 = 0x0000000000000000
    planes = 4; rows = 9; cols = 7
    m3 = 0x7FFCC94027F0; m3[0] = 0x7FFCC9402840; m3[0][0] = 0x7FFCC9802000
    Plane 1:
     111 112 113 114 115 116 117
     121 122 123 124 125 126 127
     131 132 133 134 135 136 137
     141 142 143 144 145 146 147
     151 152 153 154 155 156 157
     161 162 163 164 165 166 167
     171 172 173 174 175 176 177
     181 182 183 184 185 186 187
     191 192 193 194 195 196 197
    
    Plane 2:
     211 212 213 214 215 216 217
     221 222 223 224 225 226 227
     231 232 233 234 235 236 237
     241 242 243 244 245 246 247
     251 252 253 254 255 256 257
     261 262 263 264 265 266 267
     271 272 273 274 275 276 277
     281 282 283 284 285 286 287
     291 292 293 294 295 296 297
    
    Plane 3:
     311 312 313 314 315 316 317
     321 322 323 324 325 326 327
     331 332 333 334 335 336 337
     341 342 343 344 345 346 347
     351 352 353 354 355 356 357
     361 362 363 364 365 366 367
     371 372 373 374 375 376 377
     381 382 383 384 385 386 387
     391 392 393 394 395 396 397
    
    Plane 4:
     411 412 413 414 415 416 417
     421 422 423 424 425 426 427
     431 432 433 434 435 436 437
     441 442 443 444 445 446 447
     451 452 453 454 455 456 457
     461 462 463 464 465 466 467
     471 472 473 474 475 476 477
     481 482 483 484 485 486 487
     491 492 493 494 495 496 497
    
    m3 = 0x0000000000000000
    

    这有助于测试,如果出现故障,那么您可以直接进入框中。您可以使用vagrant planes = 30000; rows = 100000; cols = 100000000 alloc3d79(9018,0x7fffa5d79340) malloc: *** mach_vm_map(size=2400000000000000000) failed (error code=3) *** error: can't allocate region *** set a breakpoint in malloc_error_break to debug Memory allocation failed for 3D array of size 30000x100000x100000000 doubles 插件来更新driver: name: vagrant network: - ["private_network", { type: "dhcp" }] 当前的IP地址。

    因此,您可以在本地浏览器中查看http://default-centos-74.vagrantup.com来检查该实例。您也可以通过这样的方式为您的套件命名,即每个套件都可以为每个套件命名,例如为每个套件添加前缀等等;

    HostManager

    以及其他/etc/hosts

    suites:
      - name: elasticsearch-default
    

    仍然会导致有用的命名;

    http://elasticsearch-default-centos-74.vagrantup.com

    然而,最近出现的问题是chrome和firefox已经开始执行HSTS,这使得尝试访问使用.kitchen.yml PITA映射的非HTTPS本地站点。

    主要是摆脱vagrantup.com后缀。然而,这是硬编码的,并且过度编写它的唯一选择是在suites: - name: java-default 中,这是不幸的,因为它在生成Vagrantfile时不知道套件和平台,所以它没有多大用处。

    您可以使用chef / ansible重命名该框,但这不是很好。我提出的解决方案是这样的;

    您可以在/etc/hosts;

    中设置自定义.kitchen.yml
    Vagrantfile.erb

    然后将.kitchen.yml从本地方框中的宝石中复制到测试厨房仓库的根目录中。我在--- driver: name: vagrant network: - ["private_network", { type: "dhcp" }] vagrantfile_erb: Vagrantfile.erb

    然后通过在第36行更改它来为您的框设置任意名称;

    Vagrantfile.erb

    或者您可以像这样修改它,并允许从.kitchen.yml配置

    过度骑行
    /home/user1/.gem/ruby/gems/kitchen-vagrant-1.3.0/templates/Vagrantfile.erb

    https://gist.github.com/tolland/fe01eb0f46d26850cc5c98e167578f7b

    然后通过在.kitchen.yml中设置c.vm.hostname = "<%= @instance.name %>.<%= config[:kitchen_root].split('/')[-1] %>.testbox" 36c36 < c.vm.hostname = "<%= config[:vm_hostname] %>" --- > c.vm.hostname = "<%= @instance.name %>.<%= config[:var_domain] ? config[:var_domain] : config[:kitchen_root].split('/')[-1] %>.<%= config[:var_suffix] ? config[:var_suffix] : "vagrantup.com" %>" 99d98 < 来设置任意名称

    var_suffix