Ubuntu Pastebin

Paste from smoser at Thu, 20 Jul 2017 19:08:24 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
$ cat my-manual.yaml
version: 1
config:
  - type: physical
    name: eth0
    mac_address: "52:54:00:12:34:00"
    subnets:
      - type: static
        address: 192.168.1.2/24
      - type: manual
        address: 192.168.1.3/24


$ rm -Rf out.d; PYTHONPATH=$PWD ./tools/net-convert.py  --network-data=my-manual.yaml --kind=yaml --mac=eth0,aa:bb:cc:dd:e8:00 --directory=out.d --output-kind=sysconfig
Input YAML
config:
-   mac_address: '52:54:00:12:34:00'
    name: eth0
    subnets:
    -   address: 192.168.1.2/24
        type: static
    -   address: 192.168.1.3/24
        type: manual
    type: physical
version: 1


Internal State
!!python/object:cloudinit.net.network_state.NetworkState
_network_state:
    dns:
        nameservers: []
        search: []
    interfaces:
        eth0:
            address: null
            gateway: null
            inet: inet
            mac_address: '52:54:00:12:34:00'
            mode: manual
            mtu: null
            name: eth0
            subnets:
            -   address: 192.168.1.2
                netmask: 255.255.255.0
                prefix: 24
                routes: []
                type: static
            -   address: 192.168.1.3/24
                routes: []
                type: manual
            type: physical
    routes: []
    use_ipv6: false
_version: 1
use_ipv6: false


$ cat out.d/etc/sysconfig/network-scripts/ifcfg-eth0
# Created by cloud-init on instance boot automatically, do not edit.
#
BOOTPROTO=none
DEVICE=eth0
HWADDR=52:54:00:12:34:00
IPADDR=192.168.1.2
NETMASK=255.255.255.0
NM_CONTROLLED=no
ONBOOT=no
TYPE=Ethernet
USERCTL=no
Download as text