PHRAS-2533 Inject containers hostname on /etc/hosts file

This commit is contained in:
Xavier Rousset
2019-04-17 17:47:45 +02:00
parent 905ddcb836
commit 4203a814a4
3 changed files with 8 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
---
- name: Update /etc/hosts
lineinfile: dest=/etc/hosts regexp='^127\.0\.0\.1' line='127.0.0.1 localhost {{ vagrant_local.vm.docker-hosts-container|default('') }}' owner=root group=root mode=0644
when: vagrant_local.vm.docker-hosts-container is defined

View File

@@ -10,3 +10,5 @@
- name: Update /etc/hosts
lineinfile: dest=/etc/hosts regexp='^127\.0\.0\.1' line='127.0.0.1 localhost {{ vagrant_local.vm.hostname|default('') }}' owner=root group=root mode=0644
when: vagrant_local.vm.hostname is defined
- include: docker-hosts-container.yml

View File

@@ -48,6 +48,8 @@ vagrant_local:
sharedfolder: ./
useVagrantCloud: '1'
syncType: nfs
hostname: ''
docker-hosts-container: 'db elasticsearch redis rabbitmq'
nginx:
install: '1'
docroot: /vagrant