Forum: CFEngine Help Subject: Re: Clarification on parameter passing with bundles / classes Author: frans Link to topic: https://cfengine.com/forum/read.php?3,24247,24249#msg-24249
Have you considered using the unzipped war file as a masterfiles source and skipping the intermediate copy and unzip? That may be my next step but I feel like the approach above should be doable. There is also the issue of atomicity -- if a new zip file is available then the existing directory should be removed before any unzipping takes place. I'm not sure how to do this with cf3 using just a recursive copy. 'rsync' offers capabilities to delete files on the client that don't exist on the remote host but I haven't seen such in cf3. Is this line in error? Yes, sorry, that was a mistake I made in obfuscating the code. The existing promise is correct: "/somewhere/$(zipfiles).war" create => "true", copy_from => remote_dcp("$(def.source_dir)/somewhere/$(zipfiles).war.$(sys.uqhost)","$(sys.policy_hub)"), file_select => exclude("restart.tomcat.$(sys.uqhost)"), classes => if_repaired("$(allwars)"); I'm using a method because the same thing needs to happen to all war files that come in -- delete the existing directory. I have two files that need special handling in that they need to be unzip'd and into different locations. Even if my approach is flawed I don't see why cfengine is only calling the method twice when all members of the slist are reported as being activated as classes upon copy. Equally bad is the seemingly erroneous invocation of the commands: promises as shown in my first post. I should have noted - I'm using cfengine 3.2.1 community on CentOS 6.0 x64. Thanks, F _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine