Search code examples
vagrant

Using Vagrant Trigger to Start Redis-Server Failing


I'm trying to add "redis-server --daemonize yes" to my Vagrant file using Trigger, but its failing with this message:

The executable 'redis-server' Vagrant is trying to run was not found in the PATH variable.

Before trying this method, I always just would run the command once I ssh'ed into my box and it always worked as-is.

Here is the code in my Vagrantfile:

  config.trigger.after :up do |trigger|
   trigger.info = "Starting Redis"
   trigger.name = "Redis Server"
   trigger.run = { inline: "redis-server --daemonize yes" }
  end

Does anyone have any recommendations? if I have to put it into the PATH, what would I put?

Thanks


Solution

  • Vagrant Trigger run run a inline or remote script on the host

    Per your comments you want the command to be run on the guest/VM so you need to use the run_remote option: A collection of settings to run a inline or remote script on the host.