[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: editfiles methodology question
From: |
Viraj Alankar |
Subject: |
Re: editfiles methodology question |
Date: |
Sun, 6 Nov 2005 15:11:32 -0500 |
On 11/6/05, Mark Burgess <Mark.Burgess@iu.hio.no> wrote:
> On Sun, 2005-11-06 at 12:55 -0500, Viraj Alankar wrote:
> > Hello,
> >
> > I have a certain task that I'd like to do but not sure what the best
> > way to do it with cfengine. Any advice appreciated.
> >
> > Let's say I want have a file /etc/httpd/conf.d/log_sql.conf that looks
> > like the following on a couple of servers:
> >
> > LoadModule log_sql_module modules/mod_log_sql.so
> > LoadModule log_sql_mysql_module modules/mod_log_sql_mysql.so
> > LogSQLLoginInfo mysql://my:login@mysqlclust1/apachelogs
> > LogSQLCreateTables on
> > LogSQLMassVirtualHosting On
> > LogSQLTransferLogFormat AabHhMmRrSsTUuv
> > LogSQLMachineID $(short_hostname)
> >
> > Now short_hostname should be replaced with a variable that I define:
> >
> > short_hostname = ( ExecResult(/bin/hostname -s) )
>
> As Brendan said, you don't need to do this. Use $(host) from cfagent.
> You don't have to copy by checksum, you can copy by date (the default),
> in which case there will be no problem with editing the file afterwards.
> In that case you example already looks fine.
Thanks, I see there are many ways to do this and decided on the copy
by date with an appropriate editfiles just for the needed line. That
seems the simplest. I also see that the EmptyEntireFilePlease option
would work.
Regarding short_hostname, on my system '/bin/hostname' returns the
FQDN. If I try using $(host), I just get the FQDN. Is that normal?
That's why I'm using my own variable.
> If the file contains $(macro) like instances already, you could simply
> ask cfagent to expand them using "ExpandVariables". Alernatively you
> could use a
I'm a little confused on how to use template files. Since the template
file is on a server, how do I get it part of the editfiles? I'm only
familiar with using 'server=' in copy:. Do I need to copy the file
over first? If so, how do I make sure to do that before an edit (and
if possible, to avoid worrying about this ordering)?
Viraj.
- editfiles methodology question, Viraj Alankar, 2005/11/06
- Re: editfiles methodology question, Brendan Strejcek, 2005/11/06
- Re: editfiles methodology question, Mark Burgess, 2005/11/06
- Re: editfiles methodology question, Brendan Strejcek, 2005/11/06
- Re: editfiles methodology question,
Viraj Alankar <=
- Re: editfiles methodology question, Mark Burgess, 2005/11/06
- Re: editfiles methodology question, Eli Stair, 2005/11/07
- Re: editfiles methodology question, Mark Burgess, 2005/11/07
- Re: editfiles methodology question, Eli Stair, 2005/11/07
- Re: editfiles methodology question, Mark Burgess, 2005/11/07
- Re: editfiles methodology question, Atom Powers, 2005/11/07