ansible wget 然后执行脚本 =>get_url 等价物 [英] ansible wget then exec scripts => get_url equivalent
本文介绍了ansible wget 然后执行脚本 =>get_url 等价物的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我总是想知道使用ansible方式"(使用get_url
等)替换以下shell
任务的好方法是什么:
I always wonder what is the good way to replace the following shell
tasks using the "ansible way" (with get_url
, etc.):
- name: Install oh-my-zsh
shell: wget -qO - https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | bash -
或
- name: Install nodesource repo
shell: curl -sL https://deb.nodesource.com/setup_5.x | bash -
推荐答案
这对我有用:
- name: Download zsh installer
get_url: url=https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh dest=/tmp/zsh-installer.sh
- name: Execute the zsh-installer.sh
shell: /tmp/zsh-installer.sh
- name: Remove the zsh-installer.sh
file: path=/tmp/zsh-installer.sh state=absent
这篇关于ansible wget 然后执行脚本 =>get_url 等价物的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文