繁体   English   中英

在云 init runcmd 中使用 pipe 失败

[英]Using a pipe in cloud init runcmd fails

如何使用 pipe 在我的云初始化脚本的runcmd部分中重定向命令的 output? 以下失败:

runcmd:
    - [curl, -sk, https://example.com/packages/current/install.bash, '|', /bin/bash, -s,  agent:certname=XYZ.com] 

它最终创建了一个如下所示的脚本:

'curl' '-sk' 'https://example.com/packages/current/install.bash' '|' '/bin/bash' '-s' 'agent:certname=XYZ.com'

因为 pipe 被引用,所以脚本失败。 我怎样才能解决这个问题?

而不是使用数组,使用单个字符串。

runcmd:
    - 'curl -sk "https://example.com/packages/current/install.bash" | /bin/bash -s,  agent:certname=XYZ.com'

另见: https//www.digitalocean.com/community/questions/help-with-cloud-init-syntax-for-runcmd

暂无
暂无

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

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