0.1.0 • Published 6 years ago

run-on-host v0.1.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

run-on-host build status

Runs a given command on a specific ansible host.

Usage:

  run-on-host <host> <command>
  # OR verbose with more options
  run-on-host --host=<host> [--root=<ansible root>] <command>

Example:
  run-on-host vagrant ls -la /var/log
  run-on-host --host=vagrant ls -la /var/log

Installation

npm install run-on-host

API

runOnHost

Attempts to run the given command on the supplied ansible host via ssh. Determines user, hostname and port from the ansible-inventory.

Parameters

  • cmd String command to fun, i.e. ls -la /var/log
  • host String the ansible host to run the command on
  • $0 Object options
    • $0.ansibleRoot String? the root directory, i.e. where the ansible.cfg file lives (optional, default cwd)
    • $0.pipe Boolean? if true pipes command output to stdout/stderr (optional, default true)

Returns Promise that resolves once command completed or rejects if something goes wrong

License

MIT