diff --git a/lib.cf b/lib.cf index 7e08533..d787ac4 100644 --- a/lib.cf +++ b/lib.cf @@ -117,3 +117,35 @@ body contain wmde_cmd_useshell useshell=>"useshell"; } + + +bundle agent download_and_untar( + name, + sync_src, + sync_dst, + install_dir, + test_file +) +{ +classes: + "$(name)_untar" expression => not(fileexists("$(test_file)")); + +files: + "$(sync_dst)" + copy_from => sync_cp("$(sync_src)","$(sys.policy_hub)"), + handle => "$(name)_tgz_copied", + classes => if_repaired ("$(name)_untar"), + perms => m(644); + +commands: + + "$(name)_untar":: + "/usr/bin/tar" + args => "xzvf $(sync_dst) -C $(install_dir)", + depends_on => {"$(name)_tgz_copied"}, + handle => "$(name)_untarred"; +reports: +# "TESTFILE: $(test_file)"; + +} +