Modify your Vagrantfile to pass ANSIBLE_ARGS
config.vm.provision "ansible" do |ansible|
ansible.playbook = "dev.yml"
# Etc
ansible.raw_arguments = Shellwords.shellsplit(ENV['ANSIBLE_ARGS']) if ENV['ANSIBLE_ARGS']
endExample usage:
ANSIBLE_ARGS='--tags="nginx,php" "some_var=value"' vagrant provisionCall a playbook directly
ansible-playbook -i inventory —private-key=~/.vagrant.d/insecure_private_key -u vagrant dev.yml —tags="nginx, php"Modify your Vagrantfile to load specific tags
app.vm.provision “ansible” do |ansible|
ansible.playbook = “dev.yml”
ansible.tags=”nginx,php”
end