cluster:Cfengine/302/client
Contents |
cfengine v.3.0.2
Prepare
Strictly speaking, the cfengine software do not use a client-server model. It can be named as an agent-server model, where server is an agent, installed into the master host. The reference installation configuration are stored into the subversion (svn) repository of Karlsruhe Institute of Technology. Thus, some preparation steps include:
- download the dgiref.repo from
http://mirror.scc.kit.edu/downloads/yum.repo/sl-dgiref.repointo/etc/yum.repos.d/ - install
subversionto communicate with svn server
- Firewall configuration
Port 5308 should be open (how to open port in firewall).
administrator's script: prepare.sh
#!/bin/bash# prepare cfengine client#-> start routineREPO_URL="http://dgiref.d-grid.de/svn/dgiref/PROD/cf3/repl/repos/external/"
wget -O /etc/yum.repos.d/sl-dgiref.repo ${REPO_URL}/sl-dgiref.repo
#<- end routine
Install
The following step is needed to install a cfengine agent (execute as root user):
| use yum or rpm to install cfengine masterhost from http://mirror.scc.kit.edu/downloads/
|
administrator's script: install.sh
#!/bin/bash# install cfengine client#-> start routineyum -y install cfengine-community-3.0.3-1
#<- end routine
Configure
To configure the cfengine v.3 agent, the following steps should be done:
- download the
cf3.preconffrom codebase repository into cfengine directory/var/cfengine/ - change mode to executable and execute
/var/cfengine/cf3.preconfbash script. - configure the site by changing the parameters in the
/var/cfengine/masterfiles/inputs/library/variables.cf - run
cf-agentto constrain cfengine master host configuration
administrator's script: configure.sh
#!/bin/bash# prepare cfengine clientipMASTERHOST=10.0.171.195ipCLIENT=10.0.171.196#-> start routine# generate ssh keyscf-key
# key exchange from the client side#scp $ipMASTERHOST:/var/cfengine/ppkeys/localhost.pub /var/cfengine/ppkeys/root-$ipMASTERHOST.pubscp /var/cfengine/ppkeys/localhost.pub $ipMASTERHOST:/var/cfengine/ppkeys/root-$ipCLIENT.pub
# get the configurationsscp -r $ipMASTERHOST:/var/cfengine/inputs/* /var/cfengine/inputs/
# preconfiguresh /var/cfengine/masterfiles/cf3-int.preconf
cf-agent -K#<- end routine
Proceed
To run the agent use the cf-agent command.
administrator's script: proceed.sh
#!/bin/bash# prepare cfengine client#-> start routine# run cf-agentcf-agent
#<- end routine
Initial test
Examine the output for the cf-agent or test the individual promise with cf-promise promise.name
administrator's script: test.sh
#!/bin/bash# prepare cfengine client#-> start routine# Examine the output for the cf-agent or# test the individual promise with cf-promise promise.namecf-agent
#<- end routine
Update
Use yum update/remove to update or remove the package.
administrator's script: update.sh
#!/bin/bash# prepare cfengine client#-> start routine# use yum to updateyum update cfengine-3.0.2# use yum to removeyum remove cfengine-3.0.2#<- end routine