1 # Copyright (c) 2017-2018 Intel Corporation.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 - name: Add network-data
17 path: "{{ network_config }}"
18 insertafter: 'ethernets:'
21 {{ 'enp0s%d:'| format( slot_address | int) }}
23 mac_address: {{ '52:54:00:5d:7d:%02x'| format( mac_address_counter | int) }}
25 - {{ interface_item.ip }}/{{ interface_item.netmask }}
28 - name: Remove the marker introduced in network-data
30 dest: "{{ network_config }}"
34 - name: Add new children nodes to "domain" node
36 path: "{{ xml_file }}"
37 xpath: /domain/devices
43 - name: Add new children nodes to "domain" node
45 path: "{{ xml_file }}"
46 xpath: /domain/devices/interface
49 bridge: "{{ interface_item.network }}"
56 slot: "{{ '0x%02x'| format( slot_address | int) }}"
59 address: "{{ '52:54:00:5d:7d:%02x'| format( mac_address_counter | int) }}"
63 slot_address: "{{ slot_address | int + 1 }}"
65 mac_address_counter: "{{ mac_address_counter | int + 1 }}"