瀏覽代碼

Set public_v4 to private_v4 if it doesn't exist

The DNS code expects a `public_v4` even when we use the provider
networks. Let's just always export it.
Tomas Sedovic 7 年之前
父節點
當前提交
3fb3db798d
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      playbooks/provisioning/openstack/sample-inventory/inventory.py

+ 3 - 2
playbooks/provisioning/openstack/sample-inventory/inventory.py

@@ -72,8 +72,9 @@ if __name__ == '__main__':
             'ansible_host': ssh_ip_address
         }
 
-        if server.public_v4:
-            vars['public_v4'] = server.public_v4
+        public_v4 = server.public_v4 or server.private_v4
+        if public_v4:
+            vars['public_v4'] = public_v4
         # TODO(shadower): what about multiple networks?
         if server.private_v4:
             vars['private_v4'] = server.private_v4