redhat-nfvpe / ansible-role-vm-spinup

Sets up a virtualization host and spins up libvirt VMs for labs
Apache License 2.0
3 stars 7 forks source link

Add default(null) for static configuration #21

Closed leifmadsen closed 6 years ago

leifmadsen commented 6 years ago

When you aren't using a static configuration, various variables are not defined by default. This change adds null defaults for variables that won't be used in a DHCP network setup.

Closes #20

dougbtv commented 6 years ago

I do also like Tomo's idea to skip this block entirely when necessary, kind of a good idea.

Tomo had noted:

thanks. I also test it tomorrow. Now I'm temporally fixed as follwing:
{% if system_network is defined %}
if [ $# -eq 4 ]; then
    cat >> $META_DATA << _EOF_
network-interfaces: |
  auto eth0
  iface eth0 inet static
    address $4
    network {{ system_network }}
    netmask {{ system_netmask }}
    broadcast {{ system_broadcast }}
    gateway {{ system_gateway }}
    dns-nameservers {{ system_nameservers }}
    dns-search {{ system_dns_search }}
_EOF_
fi
{% endif %}
s1061123 commented 6 years ago

Close it due to #23 fixed this issue, #20.