cluster:Cfengine/3/agent
Contents |
cfengine agent v.3.x
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 masterhost#-> start routine#arch=i386arch=x86_64wget -O /etc/yum.repos.d/sl-dgiref.repo http://mirror.scc.kit.edu/downloads/yum.repo/sl-dgiref.repo
yum -y install subversion db4 pcre.$arch gcc openssl
#<- 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 masterhost#-> start routine#p_arch="el4.i386"p_arch="el5.x86_64"
rpm -ihv http://mirror.scc.kit.edu/downloads/rpms/cfengine/2010.2/cfengine-community-3.0.4-1.${p_arch}.rpm
#yum -y install cfengine-community-3.0.4-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/cf3v.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 masterhost#-> start routinewget -O /var/cfengine/cf3.preconf http://dgiref.d-grid.de/svn/dgiref/PROD/cf3/cf3.preconf
chmod +x /var/cfengine/cf3.preconf
sh /var/cfengine/cf3.preconf PROD
# or# cp -r host_which_has_cf3_configs:/var/cfengine/masterfiles /var/cfengine/# sh /var/cfengine/masterfiles/cf3-int.preconf# configure the /var/cfengine/masterfiles/inputs/library/variables.cf# run cf-agentcf-agent -K#<- end routine
Proceed
To run the agent use the cf-agent command.
administrator's script: proceed.sh
#!/bin/bash# prepare cfengine masterhost#-> 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 masterhost#-> start routine# Examine the output for the cf-agentcf-agent -vK#<- end routine
Update
Use yum update/remove to update or remove the package.
administrator's script: update.sh
#!/bin/bash# prepare cfengine masterhost#-> start routine# use yum to updateyum update cfengine-3.0.4# use yum to removeyum remove cfengine-3.0.4#<- end routine