Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 77 lines (48 sloc) 1.859 kB
fb37554 Licenses
Mark Burgess authored
1 # Copyright (C) Cfengine AS
2
3 # This file is part of Cfengine 3 - written and maintained by Cfengine 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 Commerical 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
9a51ca7 More missing files
Mark Burgess authored
23 #######################################################
24 #
25 # Edit variable = value in a text file
26 #
27 #######################################################
28
29 body common control
30
31 {
32 any::
33
34 bundlesequence => { "testsetvar" };
35 }
36
37
38 #######################################################
39
40 bundle agent testsetvar
41
42 {
43 vars:
44
45 "v[variable_1]" string => "value_1";
46 "v[variable_2]" string => "value_2";
47
48 files:
49
50 "/tmp/test_setvar"
51
1d48c19 autoconf corrections
Mark Burgess authored
52 edit_line => setvars_v1("testsetvar.v");
9a51ca7 More missing files
Mark Burgess authored
53
54 }
55
56 #######################################################
57 # For the library
58 #######################################################
59
1d48c19 autoconf corrections
Mark Burgess authored
60 bundle edit_line setvars_v1(contexted_array_name)
9a51ca7 More missing files
Mark Burgess authored
61
62 {
63 vars:
64
d2851b9 Knowledge agent fixes
Mark Burgess authored
65 "parameter_name" slist => getindices("$(contexted_array_name)");
9a51ca7 More missing files
Mark Burgess authored
66
67 delete_lines:
68
69 "$(parameter_name).*";
70
71 insert_lines:
72
d2851b9 Knowledge agent fixes
Mark Burgess authored
73 "$(parameter_name) = $($(contexted_array_name)[$(parameter_name)])";
9a51ca7 More missing files
Mark Burgess authored
74
75 }
76
Something went wrong with that request. Please try again.