Have a conf file that is supposed to push out httpd config file updates to some webservers. it copies the files over, with certain macros in the file, such as ^^MYIP^^ and then is supposed to to a find and replace in the editfiles section to replace ^^MYIP^^ with the actual ip of the machine.
BTW I am using GNU cfengine 2.1.18 on CentOS. I'm just don't see the problem with the editfiles stanza below. I must be tired. It always returns: cf:cfengine::/var/cfengine/inputs/tm-webapp.conf:34: Unknown edit action "ReplaceALL" cf:cfengine::/var/cfengine/inputs/tm-webapp.conf:35: Unknown edit action "ReplaceALL" cf:cfengine::/var/cfengine/inputs/tm-webapp.conf:36: Unknown edit action "ReplaceALL" cf:cfengine::/var/cfengine/inputs/tm-webapp.conf:38: ReplaceAll/With mismatch before or at line cf:cfengine::/var/cfengine/inputs/tm-webapp.conf:41: Unknown edit action "ReplaceALL" cf:cfengine::/var/cfengine/inputs/tm-webapp.conf:42: Unknown edit action "ReplaceALL" cf:cfengine::/var/cfengine/inputs/tm-webapp.conf:43: Unknown edit action "ReplaceALL" cf:cfengine::/var/cfengine/inputs/tm-webapp.conf:45: ReplaceAll/With mismatch before or at line --------------------- conf file-------------------------- # configuration file for the travelmaster webapp servers control: actionsequence = ( directories copy editfiles files processes ) fqdn = ( ExecResult(/bin/hostname) ) shortname = ( ExecResult(/bin/hostname | /bin/cut -d '.' -f 1) ) myip = ( ExecResult(/sbin/ifconfig | /bin/grep 'inet addr' | /bin/grep -v 127.0.0.1 | /bin/grep -v 192.168.3.108 | /bin/a wk '{print $2}' | /bin/sed -e 's/addr://') ) directories: travelmaster_webapp:: /etc/httpd owner=root group=root mode=755 /etc/httpd/conf owner=root group=root mode=755 /etc/httpd/conf.d owner=root group=root mode=755 copy: travelmaster_webapp:: # Copy all the httpd configuration files $(configroot)/config/travelmaster/webapp/httpd dest=/etc/httpd server=$(server) recurse=inf exclude=.svn type=ctime owner=root group=root mode=644 editfiles: travelmaster_webapp:: # Edit the httpd configuration files, to set IP and hostname { /etc/httpd/conf/httpd.conf ReplaceALL "\^\^MYIP\^\^" With "$(myip)" ReplaceALL "\^\^MYFQDN\^\^" With "$(fqdn)" ReplaceALL "\^\^MYSHORTNAME\^\^" With "$(shortname)" DefineClasses "restart_httpd" } { /etc/httpd/conf.d/examples.conf ReplaceALL "\^\^MYIP\^\^" With "$(myip)" ReplaceALL "\^\^MYFQDN\^\^" With "$(fqdn)" ReplaceALL "\^\^MYSHORTNAME\^\^" With "$(shortname)" DefineClasses "restart_httpd" } files: travelmaster_webapp:: /etc/httpd owner=root group=root mode=0755 checksum=md5 action=warnall recurse=inf processes: # On restart_httpd, all you need to do is sigHUP the httpd processes, and they will re-read their config files travelmaster_webapp.restart_httpd:: "httpd" signal=hup -- *********************************** * Alex Laslavic * Linux Engineer * WorldTravel BTI * x49511 * gpg/pgp key at * http://keys.jumpbox.net ***********************************
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Help-cfengine mailing list Help-cfengine@gnu.org http://lists.gnu.org/mailman/listinfo/help-cfengine