Closed viniciusfs closed 7 years ago
Whats the harm with /etc/hosts containing the system's hostname? I don't see the harm in this.
When I set ip address on instance definition, I need system hostname pointing to ip address set, not 127.0.0.1.
That sounds like something that you can fix with ansible. If you don't like the way /etc/hosts is rendered, ansible can be used to correct it. I would prefer not to make a change of this nature.
Conditional used on https://github.com/metacloud/molecule/blob/master/molecule/cookiecutter/driver/vagrant-runtime/%7B%7Bcookiecutter.repo_name%7D%7D/vagrantfile#L220 prevents this behavior while using libvirt provider. It is the same case, the difference is that when using virtualbox provider you must set a static ip to see this behavior.
@viniciusfs I'm going to close this. If you are wanting to change the contents of /etc/hosts, feel free to write a lineinfile patch to your playbook and remove it.
Thank you for your support! I will use libvirt driver that works like expected.
Issue Type
Molecule and Ansible details
Desired Behaviour
Molecule needs to start a new instance and apply test playbook without apply any unwanted change on guest machine.
Actual Behaviour (Bug report only)
Molecule's builtin Vagrant runtime is always adding a 127.0.0.1 entry on guest's /etc/hosts file.