devopsgroup-io / vagrant-hostmanager

:pencil: A Vagrant plugin that manages hosts files within a multi-machine environment.
Mozilla Public License 2.0
1.46k stars 146 forks source link

Hostmanager duplicates records in Windows hosts file #263

Closed jalandis closed 6 years ago

jalandis commented 6 years ago

Description

The plugin updates the Windows hosts file every run duplicating records and increasing whitespace.

I believe the issue can be traced back to quoting newlines in the header and footer.

Versions

vagrant version: 2.0.4 vagrant-hostmanager: 1.8.8

Resulting Hosts File

First run:


## vagrant-hostmanager-start
10.98.76.55 localDev
10.98.76.55 tiformsdev.aicpcu.org
10.98.76.55 dev.aiforms.cpcuiia.org
10.98.76.55 dev.aiforms.aicpcu.org
10.98.76.55 dev.annualreport.aicpcu.org
10.98.76.55 dev.ccauth.theinstitutes.org
10.98.76.55 logindev.theinstitutes.org
10.98.76.55 mysqlgatekeeperdev.cpcuiia.org
10.98.76.55 dev.cpcusociety.org
10.98.76.55 membersitedev.aicpcu.org
10.98.76.56 linuxLocalDev
10.98.76.56 learningdev.theinstitutes.org
10.98.76.56 dev.theinstitutes.org
10.98.76.56 dev.aicpcu.org
10.98.76.56 dev.insurance-research.org
10.98.76.56 dev.ircweb.org
10.98.76.56 dev.igie.org
10.98.76.56 griffithfoundationdev.theinstitutes.org
10.98.76.56 dev.ceu.com
## vagrant-hostmanager-end

Second run:


## vagrant-hostmanager-start

10.98.76.55 localDev

10.98.76.55 tiformsdev.aicpcu.org

10.98.76.55 dev.aiforms.cpcuiia.org

10.98.76.55 dev.aiforms.aicpcu.org

10.98.76.55 dev.annualreport.aicpcu.org

10.98.76.55 dev.ccauth.theinstitutes.org

10.98.76.55 logindev.theinstitutes.org

10.98.76.55 mysqlgatekeeperdev.cpcuiia.org

10.98.76.55 dev.cpcusociety.org

10.98.76.55 membersitedev.aicpcu.org

10.98.76.56 linuxLocalDev

10.98.76.56 learningdev.theinstitutes.org

10.98.76.56 dev.theinstitutes.org

10.98.76.56 dev.aicpcu.org

10.98.76.56 dev.insurance-research.org

10.98.76.56 dev.ircweb.org

10.98.76.56 dev.igie.org

10.98.76.56 griffithfoundationdev.theinstitutes.org

10.98.76.56 dev.ceu.com

## vagrant-hostmanager-end

## vagrant-hostmanager-start
10.98.76.55 localDev
10.98.76.55 tiformsdev.aicpcu.org
10.98.76.55 dev.aiforms.cpcuiia.org
10.98.76.55 dev.aiforms.aicpcu.org
10.98.76.55 dev.annualreport.aicpcu.org
10.98.76.55 dev.ccauth.theinstitutes.org
10.98.76.55 logindev.theinstitutes.org
10.98.76.55 mysqlgatekeeperdev.cpcuiia.org
10.98.76.55 dev.cpcusociety.org
10.98.76.55 membersitedev.aicpcu.org
10.98.76.56 linuxLocalDev
10.98.76.56 learningdev.theinstitutes.org
10.98.76.56 dev.theinstitutes.org
10.98.76.56 dev.aicpcu.org
10.98.76.56 dev.insurance-research.org
10.98.76.56 dev.ircweb.org
10.98.76.56 dev.igie.org
10.98.76.56 griffithfoundationdev.theinstitutes.org
10.98.76.56 dev.ceu.com
## vagrant-hostmanager-end