Skip to content

Commit

Permalink
correcting domains
Browse files Browse the repository at this point in the history
  • Loading branch information
tosin2013 committed Dec 5, 2019
1 parent 33ebd51 commit e8824b3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions templates/nat_network.xml.j2
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<network>
<name>{{ item.name }}</name>
<forward mode='{{ item.mode }}'/>
<domain name="{{ public_domain }}"/>
<domain name="{{ item.external_domain }}"/>
<dns>
<host ip='{{ item.subnet.split('.')[:3] | join('.')}}.2'>
<hostname>bootstrap.{{ public_domain }}</hostname>
<hostname>bootstrap.{{ item.external_domain }}</hostname>
</host>
<host ip='{{ item.subnet.split('.')[:3] | join('.')}}.1'>
<hostname>api-int.{{ item.external_domain }}</hostname>
Expand All @@ -13,28 +13,28 @@
{% for id in range(0, item.master_count | int) -%}
<srv service='etcd-server-ssl' protocol='tcp' domain='{{ item.external_domain }}' target='etcd-{{ id }}.{{ item.external_domain }}' port='2380' priority='0' weight='10'/>
<host ip='{{ item.subnet.split('.')[:3] | join('.')}}.{{ 10 + id|int }}'>
<hostname>master-{{ id }}.{{ public_domain }}</hostname>
<hostname>master-{{ id }}.{{ item.external_domain }}</hostname>
<hostname>etcd-{{ id }}.{{ item.external_domain }}</hostname>
</host>
{% endfor %}
{% for id in range(0, item.compute_count | int) -%}
<host ip='{{ item.subnet.split('.')[:3] | join('.')}}.{{ 13 + id|int }}'>
<hostname>compute-{{ id }}.{{ public_domain }}</hostname>
<hostname>compute-{{ id }}.{{ item.external_domain }}</hostname>
</host>
{% endfor %}
</dns>

<ip address='{{ item.subnet.split('.')[:3] | join('.')}}.1' netmask='{{ item.mask }}'>
<dhcp>
<range start='{{ item.subnet.split('.')[:3] | join('.')}}.10' end='{{ item.subnet.split('.')[:3] | join('.')}}.250'/>
<host mac='{{ item.mac_start }}{{ '%02x' % item.subnet.split('.')[1]|int }}:{{ '%02x' % item.subnet.split('.')[2]|int }}:{{ '%02x' % 2 }}' name='bootstrap.{{ public_domain }}' ip='{{ item.subnet.split('.')[:3] | join('.')}}.2'/>
<host mac='{{ item.mac_start }}{{ '%02x' % item.subnet.split('.')[1]|int }}:{{ '%02x' % item.subnet.split('.')[2]|int }}:{{ '%02x' % 2 }}' name='bootstrap.{{ item.external_domain }}' ip='{{ item.subnet.split('.')[:3] | join('.')}}.2'/>

{% for id in range(0, item.master_count | int) -%}
<host mac='{{ item.mac_start }}{{ '%02x' % item.subnet.split('.')[1]|int }}:{{ '%02x' % item.subnet.split('.')[2]|int }}:{{ '%02x' % (10 + id) }}' name='master-{{ id }}.{{ public_domain }}' ip='{{ item.subnet.split('.')[:3] | join('.')}}.{{ 10 + id }}'/>
<host mac='{{ item.mac_start }}{{ '%02x' % item.subnet.split('.')[1]|int }}:{{ '%02x' % item.subnet.split('.')[2]|int }}:{{ '%02x' % (10 + id) }}' name='master-{{ id }}.{{ item.external_domain }}' ip='{{ item.subnet.split('.')[:3] | join('.')}}.{{ 10 + id }}'/>
{% endfor -%}

{% for id in range(0, item.compute_count | int) -%}
<host mac='{{ item.mac_start }}{{ '%02x' % item.subnet.split('.')[1]|int }}:{{ '%02x' % item.subnet.split('.')[2]|int }}:{{ '%02x' % (10 + item.master_count|int + id) }}' name='compute-{{ id }}.{{ public_domain }}' ip='{{ item.subnet.split('.')[:3] | join('.')}}.{{ 10 + item.master_count|int + id }}'/>
<host mac='{{ item.mac_start }}{{ '%02x' % item.subnet.split('.')[1]|int }}:{{ '%02x' % item.subnet.split('.')[2]|int }}:{{ '%02x' % (10 + item.master_count|int + id) }}' name='compute-{{ id }}.{{ item.external_domain }}' ip='{{ item.subnet.split('.')[:3] | join('.')}}.{{ 10 + item.master_count|int + id }}'/>
{% endfor %}
</dhcp>
</ip>
Expand Down

0 comments on commit e8824b3

Please sign in to comment.