大网数据广告活动
服务器运维问答

Gulp module in Ansible?

· 52CE 我爱测

Is there a module that is able to install gulp files, like is possible for npm : description: Install "coffee-script" node.js package. - npm: name=coffee-script path=/app/location description: Install "coffee-script" node.js pack…

问题原文

原帖链接 · 030 · CC BY-SA 3.0

Is there a module that is able to install gulp files, like is possible for 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

At the moment the following snippet:

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

is used to install gulp packages, but is it possible to do it as follows?

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

已采纳解答

原帖链接 · Bruce Becker · CC BY-SA 3.0

Looking at the documentation and ansible modules, the answer now seems to be "no". You need to use the Ansible command module.

A similar, but unrelated question was asked here. Until someone writes a gulp module for Ansible, you need to interact with it via the command or shell modules.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-09-15)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。