cfengine  3.15.4
About: CFEngine is a configuration management system for configuring and maintaining Unix-like computers (using an own high level policy language). Community version.
  Fossies Dox: cfengine-3.15.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

bootstrap.h
Go to the documentation of this file.
1 /*
2  Copyright 2019 Northern.tech AS
3 
4  This file is part of CFEngine 3 - written and maintained by Northern.tech AS.
5 
6  This program is free software; you can redistribute it and/or modify it
7  under the terms of the GNU General Public License as published by the
8  Free Software Foundation; version 3.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
18 
19  To the extent this program is licensed as part of the Enterprise
20  versions of CFEngine, the applicable Commercial Open Source License
21  (COSL) may apply to this file if you as a licensee so wish it. See
22  included file COSL.txt.
23 */
24 
25 #ifndef CFENGINE_BOOTSTRAP_H
26 #define CFENGINE_BOOTSTRAP_H
27 
28 #include <cf3.defs.h>
29 
30 // EVALCONTEXT POLICY SERVER:
31 void EvalContextSetPolicyServer(EvalContext *ctx, const char *new_policy_server);
32 void EvalContextSetPolicyServerFromFile(EvalContext *ctx, const char *workdir);
33 
34 // POLICY HUB FUNCTIONS:
36 bool GetAmPolicyHub(void);
37 bool WriteAmPolicyHubFile(bool am_policy_hub);
38 
39 // FAILSAFE FUNCTIONS:
40 bool WriteBuiltinFailsafePolicy(const char *workdir);
41 bool WriteBuiltinFailsafePolicyToPath(const char *filename);
42 
43 // POLICY FILE FUNCTIONS:
44 bool RemoveAllExistingPolicyInInputs(const char *inputdir);
45 bool MasterfileExists(const char *masterdir);
46 
47 // BOOTSTRAP ID FUNCTIONS:
48 char *CreateBootstrapIDFile(const char *workdir);
49 char *ReadBootstrapIDFile(const char *workdir);
50 void EvalContextSetBootstrapID(EvalContext *ctx, char *bootstrap_id);
51 
52 #endif
void UpdateLastPolicyUpdateTime(EvalContext *ctx)
Updates sys.last_policy_update variable from $(sys.masterdir)/cf_promises_validated.
Definition: bootstrap.c:167
void EvalContextSetPolicyServer(EvalContext *ctx, const char *new_policy_server)
Sets both internal C variables as well as policy sys variables.
Definition: bootstrap.c:94
void EvalContextSetPolicyServerFromFile(EvalContext *ctx, const char *workdir)
Reads the policy_server.dat and sets the internal variables.
Definition: bootstrap.c:150
char * CreateBootstrapIDFile(const char *workdir)
Definition: bootstrap.c:360
bool WriteBuiltinFailsafePolicyToPath(const char *filename)
Exposed for testing. Use WriteBuiltinFailsafePolicy.
Definition: bootstrap.c:263
bool MasterfileExists(const char *masterdir)
Definition: bootstrap.c:325
bool RemoveAllExistingPolicyInInputs(const char *inputdir)
Removes all files in $(sys.inputdir)
Definition: bootstrap.c:295
char * ReadBootstrapIDFile(const char *workdir)
Definition: bootstrap.c:385
bool WriteBuiltinFailsafePolicy(const char *workdir)
Write the builtin failsafe policy to the default location.
Definition: bootstrap.c:251
bool WriteAmPolicyHubFile(bool am_policy_hub)
Definition: bootstrap.c:211
void EvalContextSetBootstrapID(EvalContext *ctx, char *bootstrap_id)
Definition: bootstrap.c:423
bool GetAmPolicyHub(void)
Definition: bootstrap.c:191