Skip to content
Snippets Groups Projects
Commit c4c6910a authored by ines's avatar ines
Browse files

add partie 2 et debut 3

parent de90fdc9
No related branches found
No related tags found
No related merge requests found
{% for host in groups['routers'] + groups['hosts'] %}
auto {{ hostvars[host]['ifnameB'] }}
iface {{ hostvars[host]['ifnameB'] }} inet static
address {{ hostvars[host]['ipB'] }}
netmask {{ hostvars['all']['netmask'] }}
{% if host in groups['routers'] %}
auto {{ hostvars[host]['ifnameA'] }}
iface {{ hostvars[host]['ifnameA'] }} inet static
address {{ hostvars[host]['ipA'] }}
netmask {{ hostvars['all']['netmask'] }}
post-up ip route add {{ hostvars[host]['subnet'] }} nexthop via {{ hostvars[host]['nexthop'] }}
{% else %}
auto {{ hostvars[host]['ifnameA'] }}
iface {{ hostvars[host]['ifnameA'] }} inet static
address {{ hostvars[host]['ip'] }}
netmask {{ hostvars['all']['netmask'] }}
post-up ip route add default via {{ hostvars[host]['gateway'] }}
{% endif %}
{% endfor %}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment