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: Mark . Burgess
Subject: Re: editfiles: DefineClasses can't be used in multiple BeginGroupIfNoSuchLine
Date: Tue, 18 Jun 2002 10:26:53 +0200 (MET DST)

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

Mark


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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





reply via email to

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