| 1 |
body file control |
| 2 |
{ |
| 3 |
inputs => { @(map_role_bundles.inputs) }; |
| 4 |
} |
| 5 |
|
| 6 |
bundle agent main |
| 7 |
# |
| 8 |
{ |
| 9 |
methods: |
| 10 |
"classify"; |
| 11 |
"map_role_bundles"; |
| 12 |
"go"; |
| 13 |
|
| 14 |
} |
| 15 |
|
| 16 |
|
| 17 |
bundle common classify |
| 18 |
# |
| 19 |
{ |
| 20 |
vars: |
| 21 |
"variable" string => "any"; |
| 22 |
|
| 23 |
classes: |
| 24 |
"group_class_from_variable" |
| 25 |
expression => strcmp("$(variable)", "any"), |
| 26 |
comment => "Highest level classification, other classes depend on this."; |
| 27 |
|
| 28 |
"group_class_from_string" |
| 29 |
expression => strcmp("any", "any"), |
| 30 |
comment => "Highest level classification, other classes depend on this."; |
| 31 |
|
| 32 |
} |
| 33 |
|
| 34 |
bundle common map_role_bundles |
| 35 |
# |
| 36 |
{ |
| 37 |
vars: |
| 38 |
# Define bundles |
| 39 |
any:: |
| 40 |
"role[app00_zero]" |
| 41 |
string => "$(this.promise_dirname)/app00_zero.cf.sub", |
| 42 |
comment => |
| 43 |
"Roles are based on groups. Roles |
| 44 |
map to bundles. Bundles are defined in a specific file."; |
| 45 |
|
| 46 |
!any:: |
| 47 |
"role[app_zero]" |
| 48 |
string => "$(this.promise_dirname)/app_zero.cf.sub", |
| 49 |
comment => |
| 50 |
"Roles are based on groups. Roles |
| 51 |
map to bundles. Bundles are defined in a specific file."; |
| 52 |
|
| 53 |
group_class_from_variable:: |
| 54 |
"role[app_one]" |
| 55 |
string => "$(this.promise_dirname)/app_one.cf.sub", |
| 56 |
comment => |
| 57 |
"Roles are based on groups. Roles |
| 58 |
map to bundles. Bundles are defined in a specific file."; |
| 59 |
|
| 60 |
group_class_from_string:: |
| 61 |
"role[app_two]" string => "$(this.promise_dirname)/app_two.cf.sub"; |
| 62 |
|
| 63 |
any:: |
| 64 |
"bundles" slist => getindices(role); |
| 65 |
"inputs" slist => getvalues(role); |
| 66 |
} |
| 67 |
|
| 68 |
bundle agent go |
| 69 |
# |
| 70 |
{ |
| 71 |
vars: |
| 72 |
"bundles" slist => { @(map_role_bundles.bundles) }; |
| 73 |
"sorted_bundles" slist => sort(bundles, "lex"); |
| 74 |
|
| 75 |
methods: |
| 76 |
"$(sorted_bundles)" usebundle => $(sorted_bundles); |
| 77 |
} |
| 78 |
|