Added a bundle to download and untar a file
This commit is contained in:
parent
0903c9dc9b
commit
2215b75985
32
lib.cf
32
lib.cf
|
@ -117,3 +117,35 @@ body contain wmde_cmd_useshell
|
||||||
useshell=>"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)";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue