bug-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: editfiles: DefineClasses can't be used in multiple BeginGroupIfNoSuc


From: Hugo Gayosso
Subject: Re: editfiles: DefineClasses can't be used in multiple BeginGroupIfNoSuchLine
Date: 24 Jun 2002 09:40:05 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

address@hidden writes:

> This does not make sense to have the definitions inside conditionals, since 
> the classes
> are set only if the file is edited. I shall add an error message to this 
> effect in 2.0.3

Please explain what does not make sense, because that is exactly what
I want to do.

I want to define the class ONLY if the file is edited.  But which
class I want do define depends on which modification is done, this, I
think, could be implemented with using multiple 'editfiles' instead of
using 'BeginGroup....', but in this example I didn't used that.


> On 29 May, Hugo Gayosso wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> > 
> > 
> > cfengine-2.0.0
> > Red Hat Linux 7.2
> > 
> > 
> > Excerpt from input file:
> > 
> > editfiles:
> >    Mymachine::
> >       { /etc/swinstall_serial_number
> >          AutoCreate
> > 
> >          BeginGroupIfNoSuchLine "1"
> >             AppendIfNoSuchLine "1"
> >             DefineClasses "swinstall_1"
> >          EndGroup
> > 
> >          BeginGroupIfNoSuchLine "2"
> >             AppendIfNoSuchLine "2"
> >             DefineClasses "swinstall_2"
> >          EndGroup
> >       }
> > 
> > 
> > When cfengine reads this config file, it behaves as expected except
> > that it only defines "swinstall_1", it never defines "swinstall_2".
> > 
> > I manually verified that the file '/etc/swinstall_serial_number' had
> > only one line:
> > 
> > $ cat /etc/swinstall_serial_number 
> > 1
> > 
> > I also verified that cfengine is entering the correct BeginGroup
> > entry:
> > # cfagent --debug
> > [....]
> > Begin editing /etc/swinstall_serial_number
> > (Begin Group - skipping, line exists)
> > (Begin Group - no line 2)
> > Appending [2]
> > (End Group)
> > End editing /etc/swinstall_serial_number
> > [....]
> > 
> > But still swinstall_2 is not defined, swinstall_1 is, I know that
> > because there are a couple of "shellcommands" entries:
> > 
> > shellcommands:
> >    swinstall_1::
> >      "/bin/sh -c 'cd /mnt/software ; /bin/rpm -Uv perl-HTML-Tree 
> > perl-HTML-Tagset perl-HTML-Parser perl-HTML-Format'"
> > 
> >    swinstall_2::
> >      "/bin/sh -c 'cd /mnt/software ; /bin/rpm -Uv kernel-headers 
> > glibc-devel '"
> > 
> > But only the entry in swinstall_1 gets executed.
> > 
> > 
> > P.S.
> >   Any other ideas on how to configure cfengine to install software
> >   "on-demand" would be appreciated.
> > 
> > Greetings,
> > - -- 
> > Hugo Gayosso
> > Support the Free Software Movement!
> > GNU Project <http://www.gnu.org>
> > 
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.0.6 (GNU/Linux)
> > Comment: For info see http://www.gnupg.org
> > 
> > iD8DBQE89Qgtx2JZtTN6co8RAimMAKCNmH9UngLPTv1Y3vY/q3mxeC1IowCgjb3M
> > Xigdq3uMPPxpPTxoPrfD7D8=
> > =NghF
> > -----END PGP SIGNATURE-----
> 
> 
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Work: +47 22453272            Email:  address@hidden
> Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 

- -- 
Hugo Gayosso
Support the Free Software Movement!
GNU Project <http://www.gnu.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9FyE1x2JZtTN6co8RAnVAAJ9Ut5CD8abtYH5D6kgrTDDFa3HyEQCfRAWK
hNnJF8xODbFYbFv8ieudvvQ=
=UUwu
-----END PGP SIGNATURE-----



reply via email to

[Prev in Thread] Current Thread [Next in Thread]