Search code examples
vagrantvagrantfilesalt-projectvagrant-plugin

vagrant with salt provisioning - running a particular state


Is there a way I can use the salt provisioner to run only a handful of states rather than doing a full highstate?

Our full highstate does a bunch of stuff that doesn't make sense for an ephemperal development VM, and in fact, a lot of which just won't work.


Solution

  • The plugin itself only currently supports running a full highstate.

    As a workaround, you could first tell vagrant not to run highstate:

    config.vm.provision :salt do |salt|
         salt.run_highstate = false
    end
    

    Then you could use a shell provisioner to run the chosen states:

    config.vm.provision "shell",
        inline: "salt-call --local state.sls foo,bar"
    end