Commit 51f94a3
Sumit Jamgade
Added ability to include recipes smartly
Roles can get smart by making recipe inform the role about its dependencies
across the proposal.
So a recipe will be included by the role only if the attributes
registered by the recipe are actually changed in current chef-client
run.
a recipe can register its dependencies as
```
mydependson = {
"horizon::server" => [
['glance','api','bind_port']
]
}
BarclampLibrary::Barclamp::DependsOn.add(mydependson)
```
So here the "horizon::server" is informing about its
dependencies.
This is accomplished by comparing the value of the current attributes of node
against the one already stored in the databag after the previous successful
chef-client run.
BarclampLibrary::Barclamp::DependsOn.add:
takes in a map:
recipe_name => [
[barclampname,drill,down,till,value],
[otherbarclampname,onlyhere],
]
This map is flushed and recreated only everyrun, however like resources
this could also be cached.
this behaviour can be altered by adding flag to config and using it
'include_recipe_smartly', however that is an extension to this behavior
and can be addressed in subsequent commits
Use the role(proposal) that was committed to compare against databag
This object enables us to do real comparison on proposal level.
Thus every barclamp can have proposal level dependency
hound fixes and refactor1 parent 43b9e38 commit 51f94a3
File tree
2 files changed
+100
-21
lines changed- chef/cookbooks/barclamp/libraries
2 files changed
+100
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
417 | 418 | | |
418 | 419 | | |
419 | 420 | | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
420 | 434 | | |
421 | 435 | | |
422 | 436 | | |
423 | 437 | | |
424 | | - | |
425 | | - | |
426 | | - | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
427 | 462 | | |
428 | 463 | | |
429 | 464 | | |
430 | 465 | | |
431 | | - | |
432 | 466 | | |
433 | 467 | | |
434 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
435 | 508 | | |
436 | 509 | | |
437 | 510 | | |
| |||
453 | 526 | | |
454 | 527 | | |
455 | 528 | | |
456 | | - | |
457 | | - | |
458 | | - | |
459 | | - | |
460 | | - | |
461 | | - | |
462 | | - | |
463 | | - | |
464 | | - | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
471 | | - | |
472 | | - | |
| 529 | + | |
473 | 530 | | |
474 | 531 | | |
475 | 532 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments