329
|
1 |
#!/bin/bash
|
|
2 |
|
|
3 |
cat netplan.yaml \
|
|
4 |
| relpipe-in-yamltable \
|
|
5 |
--relation 'nic' \
|
|
6 |
--records '/yaml/network/ethernets/*|/yaml/network/bridges/*' \
|
|
7 |
--attribute 'name' string 'name()' \
|
|
8 |
--attribute 'type' string 'name(..)' \
|
|
9 |
--attribute 'dhcp4' boolean 'dhcp4' \
|
|
10 |
--attribute 'dhcp6' boolean 'dhcp6' \
|
|
11 |
--attribute 'accept-ra' boolean 'accept-ra' \
|
|
12 |
--relation 'bridge' \
|
|
13 |
--records '/yaml/network/bridges/*' \
|
|
14 |
--attribute 'name' string 'name()' \
|
|
15 |
--attribute 'gateway4' string 'gateway4' \
|
|
16 |
--attribute 'mtu' string 'mtu' \
|
|
17 |
--relation 'bridge_interface' \
|
|
18 |
--records '/yaml/network/bridges/*/interfaces' \
|
|
19 |
--attribute 'bridge' string 'name(..)' \
|
|
20 |
--attribute 'interface' string '.' \
|
|
21 |
--relation 'ip' \
|
|
22 |
--records '/yaml/network/bridges/*/addresses' \
|
|
23 |
--attribute 'address' string 'substring-before(., "/")' \
|
|
24 |
--attribute 'mask' string 'substring-after(., "/")' \
|
|
25 |
--attribute 'interface' string 'name(..)' \
|
|
26 |
| relpipe-out-tabular
|
|
27 |
|
|
28 |
# an early draft of the relational mapping
|