简体   繁体   English

使用wget提取和提取.zip文件的流浪木偶

[英]Vagrant Puppet using wget to fetch and extract .zip file

Hi I am creating a Vagrant setup and I am needing to fetch a .zip file which will be put in /vagrant/www directory. 嗨,我正在创建一个Vagrant安装程序,我需要提取一个.zip文件,该文件将放在/ vagrant / www目录中。

They way I am trying to do this is: 我尝试这样做的方式是:

 exec { 'setup octobercms':
    command => "/bin/sh -c 'wget -P /vagrant/www https://github.com/octobercms/install/archive/master.zip'",
    timeout => 900,
    logoutput => true
}

When vagrant up has been triggered I can see that the file is downloading but it is not appearing in the /vagrant/www directory. 触发流浪汉后,我可以看到文件正在下载,但没有出现在/ vagrant / www目录中。 The file is not really anything to do with vagrant but will be used to install October CMS. 该文件与vagrant无关,但将用于安装October CMS。

When using puppet what would be the best way to fetch a zipped file and extract its contents into a directory and remove the zipped archive? 使用p时,提取压缩文件并将其内容提取到目录中并删除压缩档案的最佳方法是什么?

Any help would be much appreciated. 任何帮助将非常感激。

The exec command is run in a generic construct of the shell, and doesn't obey the constraints of the user account evoking it. exec命令在外壳的通用构造中运行,并且没有遵循引起它的用户帐户的约束。 Try: 尝试:

exec { 'setup octobercms':
    command => "cd /vagrant/www/; /bin/sh -c 'wget https://github.com/octobercms/install/archive/master.zip'",
    timeout => 900,
    logoutput => true
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM