1#  Copyright 2021 Northern.tech AS
2
3#  This file is part of CFEngine 3 - written and maintained by Northern.tech AS.
4
5#  This program is free software; you can redistribute it and/or modify it
6#  under the terms of the GNU General Public License as published by the
7#  Free Software Foundation; version 3.
8
9#  This program is distributed in the hope that it will be useful,
10#  but WITHOUT ANY WARRANTY; without even the implied warranty of
11#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12#  GNU General Public License for more details.
13
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
17
18# To the extent this program is licensed as part of the Enterprise
19# versions of Cfengine, the applicable Commercial Open Source License
20# (COSL) may apply to this file if you as a licensee so wish it. See
21# included file COSL.txt.
22
23
24bundle common g
25{
26  classes:
27
28      "softclass" expression => "any";
29
30  vars:
31
32      "bundle" slist => { "bundle1", "bundle2", @(g.extra) };
33
34    any::
35
36      # default extra
37
38      "extra" slist => { "bundle3" },
39      policy => "overridable";
40
41    softclass::
42
43      "extra" slist => { "bundle3", "bundle4" },
44      policy => "overridable";
45
46}
47
48##############################################################
49
50body common control
51{
52      bundlesequence  => { @(g.bundle) };
53}
54
55##############################################################
56
57bundle agent bundle1
58{
59  vars:
60
61      "var1" string => "anything";
62      "bundle"  slist => { @(g.bundle) };
63
64  reports:
65      "$(bundle)";
66}
67
68bundle agent bundle2
69{
70  classes:
71
72      "ok" expression => isvariable("bundle1.var1");
73
74  reports:
75
76    ok::
77
78      "Success";
79}
80
81bundle agent bundle3
82{
83  reports:
84      "Success extra...";
85}
86
87bundle agent bundle4
88{
89  reports:
90      "Success extra more...";
91}
92