1
# Copyright (C) Cfengine AS
3
# This file is part of Cfengine 3 - written and maintained by Cfengine AS.
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.
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.
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
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.
24
#cop What should a failsafe and update file contain?,example
30
bundlesequence => { "update" };
37
"master_location" string => "$(sys.workdir)/masterfiles";
39
"policy_server" string => readfile("$(sys.workdir)/policy_server.dat",40),
40
comment => "IP address to locate your policy host.";
45
classmatch(canonify("ipv4_$(policy_server)")),
46
classmatch(canonify("$(policy_server)"))
49
comment => "Define the ip identity of the policy source host";
51
"have_ppkeys" expression => fileexists("$(sys.workdir)/ppkeys/localhost.pub");
53
"nofile" expression => fileexists("$(sys.workdir)/policy_server.dat");
59
"/usr/local/sbin/cf-key";
63
"/var/cfengine/inputs"
65
handle => "update_policy",
67
copy_from => u_scp("$(master_location)"),
68
depth_search => u_recurse("inf"),
74
copy_from => u_scp("/usr/local/sbin"),
75
depth_search => u_recurse("inf"),
82
"cf-execd" restart_class => "start_exec";
86
"cf-serverd" restart_class => "start_server";
91
"$(sys.workdir)/bin/cf-execd",
92
action => logme("executor");
95
"$(sys.workdir)/bin/cf-serverd",
96
action => logme("server");
100
bootstrap_mode.policy_host::
102
"I am the policy host - i.e. with ipv4 address $(policy_server)";
106
############################################
110
log_repaired => "stdout";
111
logstring => " -> Started the $(x) (success)";
114
############################################
122
#############################################
124
body copy_from u_scp(from)
133
servers => { "$(policy_server)" };
136
#########################################################
138
body action immediate
143
############################################
145
body depth_search u_recurse(d)