20 lines
792 B
Django/Jinja
20 lines
792 B
Django/Jinja
cloud_init:
|
|
{% if item.networks[0].ip is defined and item.networks[0].netmask is defined and item.networks[0].gateway is defined %}
|
|
nic_boot_protocol: static
|
|
nic_ip_address: "{{ item.networks[0].ip }}"
|
|
nic_netmask: "{{ item.networks[0].netmask }}"
|
|
nic_gateway: "{{ item.networks[0].gateway }}"
|
|
{% else %}
|
|
nic_boot_protocol: dhcp
|
|
{% endif %}
|
|
nic_name: {{ item.networks[0].nic_name | default(item.networks[0].device_name) | default('eth0') }}
|
|
host_name: "{{ item.name }}.{{ item.domain | default('') }}"
|
|
{% if item.dns_servers is defined %}
|
|
dns_servers: "{{ item.dns_servers|join(' ') }}"
|
|
{% endif %}
|
|
{% if item.user_name is defined %}
|
|
user_name: "{{ item.user_name }}"
|
|
{% endif %}
|
|
{% if item.root_password is defined %}
|
|
root_password: "{{ item.root_password }}"
|
|
{% endif %} |