我总是想知道使用“ansible方式”(使用get_url等)替换以下shell任务的好方法是什么:
- 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