xci: bifrost: Only use libvirt as DNS server if using proxy servers 85/54485/3
authorMarkos Chandras <mchandras@suse.de>
Mon, 26 Mar 2018 15:42:37 +0000 (16:42 +0100)
committerMarkos Chandras <mchandras@suse.de>
Tue, 27 Mar 2018 20:12:16 +0000 (21:12 +0100)
Commit 0d332a80cf731e5927c81c9f6929a8b83d43cddd ("Add proxy support")
switched the default DNS server to the libvirt bridge. However, we only
need to override the default DNS if we are behind a proxy server.

Change-Id: I7d8fe8c10a1aba2db4a703a81e74ef76fa593d95
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/infra/bifrost/playbooks/opnfv-virtual.yaml

index 3429f2e..bb0daff 100644 (file)
   become: no
   connection: local
   gather_facts: yes
+  pre_tasks:
+    - name: "Override default bifrost DNS if we are behind a proxy"
+      set_fact:
+         ipv4_nameserver: "192.168.122.1"
+      when: lookup('env','http_proxy') != ''
   roles:
     - role: ironic-enroll-dynamic
     - { role: ironic-inspect-node, when: inspect_nodes | default('false') | bool == true }
     - role: bifrost-configdrives-dynamic
-      ipv4_nameserver: 192.168.122.1
     - role: bifrost-deploy-nodes-dynamic
   environment:
     http_proxy: "{{ lookup('env','http_proxy') }}"