To test Ansible, I configured the Vagrant VM, which can be supplied with the vagrant provision specified
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 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
means the name of Vagrant VM is default . Hence,
- hosts: default
also does what i want. However, I would like to have a more specific name for the virtual machine (e.g. vagrant ).
Is there any way to change this name to something else?
source share