Ansible 中的 Gulp 模块?

Ansible 中的 Gulp 模块?

是否有一个模块可以安装 gulp 文件,例如npm

description: Install "coffee-script" node.js package.
- npm: name=coffee-script path=/app/location

description: Install "coffee-script" node.js package on version 1.6.1.
- npm: name=coffee-script version=1.6.1 path=/app/location

description: Install "coffee-script" node.js package globally.
- npm: name=coffee-script global=yes

description: Remove the globally package "coffee-script".
- npm: name=coffee-script global=yes state=absent

description: Install "coffee-script" node.js package from custom registry.
- npm: name=coffee-script registry=http://registry.mysite.com

description: Install packages based on package.json.
- npm: path=/app/location

description: Update packages based on package.json to their latest version.
- npm: path=/app/location state=latest

description: Install packages based on package.json using the npm installed with nvm v0.10.1.
- npm: path=/app/location executable=/opt/nvm/v0.10.1/bin/npm state=present

目前以下代码片段:

- command: /usr/local/lib/npm/bin/gulp
  args:
    chdir: "{{ project_dir }}"

用于安装gulp包,但是可以按如下方式进行吗?

description: Install packages based on package.json.
- gulp: path=/app/location

答案1

查看文档和 ansible 模块,答案现在似乎是“不”。需要使用 Ansiblecommand模块。

有人提出了类似但不相关的问题这里。直到有人为 Ansible 编写 gulp 模块,您才需要通过命令或 shell 模块与其交互。

相关内容