For testing Ansible, I've set up a Vagrant VM which can be provisioned with vagrant provision
, given
config.vm.provision "ansible" do |ansible|
ansible.playbook = "site.yml"
end
in the Vagrantfile
. This works when I set hosts
to all
,
- hosts: all
sudo: true
roles:
- common
- ssl
- webserver
Alternatively, the file
.vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory
which is generated by Vagrant itself says
default ansible_ssh_host=127.0.0.1 ansible_ssh_port=2222
meaning that the name of the Vagrant VM is default
. Hence,
- hosts: default
also does what I want. However, I'd like to have a more specific name for the VM (like vagrant
, for example).
Is there a way to change that name to something else?