help-cfengine
[Top][All Lists]
Advanced

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

Re: iterators in copy::


From: John Sechrest
Subject: Re: iterators in copy::
Date: Sat, 31 Jan 2004 16:56:38 -0800

The manual that I am looking at suggests that List iteration
works in:

 In the `from' field of a copy action,
 In the directory field of the copy action,


When I try what you sent, I end up seeing:

COPY /etc/hosts.allow:/etc/hosts.deny:/etc/inetd.conf
 Mode +644
     -7133
 TO dest: /tmp/x
 action: fix
 Size > -1
 IfElapsed=15, ExpireAfter=240
 recurse=0
 xdev = n
 uids = ( 0 )
 gids = ( 0 )
 filters:
 exclude:
 ignore:
 symlink:
 include:
 classes = any
 method = c (time/checksum)
 server = localhost (encrypt=n,verified=n)
 accept the server's public key on trust? n
 purging = n
 Define 
 ElseDefine 
 FailoverClasses 
 Single backup archive


Which suggests that the spliton variable is not set to :...
let's see

Yep. That fixes one error:

COPY /etc/hosts.allow
 Mode +644
     -7133
 TO dest: /tmp/x
 action: fix
 Size > -1
 IfElapsed=15, ExpireAfter=240
 recurse=0
 xdev = n
 uids = ( 0 )
 gids = ( 0 )
 filters:
 exclude:
 ignore:
 symlink:
 include:
 classes = any
 method = c (time/checksum)
 server = localhost (encrypt=n,verified=n)
 accept the server's public key on trust? n
 purging = n
 Define 
 ElseDefine 
 FailoverClasses 
 Single backup archive


But it is still not copying....

This suggests that the admin part is not set up to allow it.

Let's see... I am seeing:

cf:host8: Checksum comparison replaced by ctime: files not regular
cf:host8: /etc/hosts.allow -> /tmp/x
cf:host8: image exists but destination type is silly (file/dir/link doesn't matc
h)
cf:host8: source=/etc/hosts.allow, dest=/tmp/x
Checking copy from localhost:/etc/hosts.deny to /tmp/x
cf:host8: Checksum comparison replaced by ctime: files not regular
cf:host8: /etc/hosts.deny -> /tmp/x
cf:host8: image exists but destination type is silly (file/dir/link doesn't matc
h)
cf:host8: source=/etc/hosts.deny, dest=/tmp/x


which suggests that my error is in replacing the dest with a directory.
let me see...

COPY /etc/hosts.allow
 Mode +644
     -7133
 TO dest: /tmp/x//etc/hosts.allow:/etc/hosts.deny:/etc/inetd.conf
 action: fix
 Size > -1
 IfElapsed=15, ExpireAfter=240
 recurse=0
 xdev = n
 uids = ( 0 )
 gids = ( 0 )
 filters:
 exclude:
 ignore:
 symlink:
 include:
 classes = any
 method = c (time/checksum)
 server = localhost (encrypt=n,verified=n)
 accept the server's public key on trust? n
 purging = n
 Define 
 ElseDefine 
 FailoverClasses 
 Single backup archive


Nope... that did not work.

So... A) you can not copy to a directory
and   B) you can not iterate over a list in the
         destination...


And... If you put it in the dir section it still failes....

Yes, I agree with you. Having iterate work in the destination field
     would be nice.

However. wait a second... I have a directory that I am copying.

any::
     $(mastermlndir)            dest=$(mlndir)
                                  r=inf
                                  mode=755
                                  type=checksum
                                  exclude=*.lst
                                  exclude=*~
                                  exclude=#*
                                  server=$(policyhost)
                                  trustkey=true


And this works.

    So if dir matches dir, it will work.

 I wonder if there is a way to use a module to do it...

    




John Gray <gray@agora-net.com> writes:

 % iterators don't appear to work on the copy stanza?  This sure would 
 % allow me to reduce the length of the stanza (I have a number of options 
 % of each file, so it gets rather long).
 % 
 % I was hoping to do something like:
 % 
 % files = ( /etc/hosts.allow:/etc/hosts.deny:/etc/inetd.conf:...)
 % $(mf)$(files)        dest=$(files)
 %              mode=644
 %              owner=root
 %              group=root
 %              type=checksum
 %              server=server.domain.com
 % 
 % then repeat this for another set of files with slightly different options.
 % 
 % Over quite a number of files, I only use about 5 different sets of options.
 % 
 % Did I just get the syntax wrong?  Is there another way to apply a bunch 
 % options to a set of files without expanding them all out?
 % 
 % Thanks,
 % 
 % John
 % 
 % -- 
 % John Gray
 % AgoraNet, Inc.                      (302) 224-2475
 % 102 E. Main Street, Suite 303       (302) 224-2552 (fax)
 % Newark, De 19711                    http://www.agora-net.com
 % 
 % 
 % _______________________________________________
 % Help-cfengine mailing list
 % Help-cfengine@gnu.org
 % http://mail.gnu.org/mailman/listinfo/help-cfengine

-----
John Sechrest          .         Helping people use
                        .           computers and the Internet
                          .            more effectively
                             .                      
                                 .       Internet: sechrest@peak.org
                                      .   
                                              . http://www.peak.org/~sechrest




reply via email to

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