Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 1 | |
| 2 | {# |
| 3 | Copyright 2017-present Open Networking Foundation |
| 4 | |
| 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | you may not use this file except in compliance with the License. |
| 7 | You may obtain a copy of the License at |
| 8 | |
| 9 | http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | Unless required by applicable law or agreed to in writing, software |
| 12 | distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | See the License for the specific language governing permissions and |
| 15 | limitations under the License. |
| 16 | #} |
| 17 | |
| 18 | |
Zack Williams | ba5549c | 2017-03-25 15:04:45 -0700 | [diff] [blame] | 19 | {% for node in physical_node_list if node.name == ansible_hostname %} |
| 20 | auto {{ node.interface | default(mgmt_interface) }} |
| 21 | |
| 22 | iface {{ node.interface | default(mgmt_interface) }} inet static |
| 23 | address {{ mgmt_ipv4_first_octets }}.{{ node.ipv4_last_octet }} |
| 24 | network {{ mgmt_ipv4_first_octets }}.0 |
| 25 | netmask 255.255.255.0 |
| 26 | broadcast {{ mgmt_ipv4_first_octets }}.255 |
| 27 | {% if node.gateway_enabled is defined and node.gateway_enabled %} |
| 28 | gateway {{ mgmt_ipv4_first_octets }}.1 |
| 29 | {% endif %} |
| 30 | {% endfor %} |