File: maparray_multi_index.cf

package info (click to toggle)
cfengine3 3.24.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 37,552 kB
  • sloc: ansic: 163,161; sh: 10,296; python: 2,950; makefile: 1,744; lex: 784; yacc: 633; perl: 211; pascal: 157; xml: 21; sed: 13
file content (55 lines) | stat: -rw-r--r-- 1,846 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
###########################################################
#
# Test maparray for multi-index arrays
# Redmine#6033
#
###########################################################

body common control
{
    inputs => { "../../default.cf.sub" };
    bundlesequence => { default("$(this.promise_filename)") };
    version => "1.0";
}

###########################################################

bundle agent init
{
}

###########################################################

bundle agent test
{
  vars:
    "bundles[x][y][z1]" string => "xyz1";
    "bundles[x][y][z23]" slist => { "xyz2", "xyz3" };

    "bundles[zculib][mypaths]"    slist => { "pathsa.cf", "pathsb.cf" };
    "bundles[zculib][myservices]" slist => { "myservices.cf" };

    #make sure that below variables will be not mapped
    "bundles[zcuinventory][zcuinventory]"             slist => { "inv_zcuinventory.cf" };
    "bundles[zcuinventory][inventory_fibrechannel]"   slist => { "inv_fibrechannel.cf" };
    "bundles[zcuinventory][inventory_virtualization]" slist => { "inv_virtualization.cf" };
    "bundles[services][afs]"          slist => { "afs.cf", "afsadm.cf" };
    "bundles[services][base]"         slist => { "base.cf", "base2.cf" };    

    "bundles[onelevel1]" slist => { "onelevel1_avalue", "onelevel1_bvalue" };    
    "bundles[onelevel2]" string => "onelevel2value";    

    "inputs"        slist => maparray("zculib/$(this.v)","bundles[zculib]");
    "merged_bundles" data => mergedata(bundles);
    "merged_zculib" data => mergedata("bundles[zculib]");
}

###########################################################

bundle agent check
{
  methods:
      "check"  usebundle => dcs_check_state(test,
                                           "$(this.promise_filename).expected.json",
                                           $(this.promise_filename));
}