Ansible role to provision a zone on OpenIndiana
Olaf Bohlen
2020-08-19 3ada41b2e02817175192ac3e44f261ee76993a66
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
71
72
---
# defaults file for oi-zone
oizone:
  name: oizone
  zoneroot: /export/zones/
  autoboot: "true"
  bootargs: # -v
  iptype: exclusive
  cpus: dedicated # dedicated or capped-cpu
  ncpus: 1
  mem: capped-memory # or nil
  ram: 1G
  swap: 1G
  locked: 1G
  brand: ipkg
  filesystems:
    - path: /export/zones/oizone
      type: zoneroot
      zfscreate: true
      zfs_extra_properties:
        refquota: 10G
    - path: apppool/oizone/datavol1
      type: volume
      zfscreate: true
      zfs_extra_properties:
        volsize: 5G
    - path: apppool/oizone/dataset1
      type: dataset
      zfscreate: true
      zfs_extra_properties:
        quota: 2G
    - path: /disk1
      type: lofs
      mountpoint: /hostdisks/disk1
      zfscreate: false
      options:
        - ro
        - nodevices
  nics:
    - physical: ixgbe0
      logical: oizoneint0
      vlan: 100
      address: dhcp  # can be "dhcp" or a regular IP address
      addrsuffix: v4 # can be a string, interface0/suffix will be the ipadm create-addr
  kvm:
    vnc: "on"
    bootorder: cd
  sysding:
    timezone: UTC
    locale: C
    ip:
      routes:
        - target: default # can be a CIDR or a host ip or "default"
          router: 172.18.0.200 # IP of the router
      dns:
        nameservers:
          - 1.1.1.1
          - 8.8.8.8
        search:
          - example.com
          - openindiana.org
        domain: example.com
    users:
      - name: root
        hashedpassword: "$5$foobar...."
      - name: localadm
        uid: 100
        gid: 10
        shell: /usr/bin/bash
        gecos: "Local Admin Account"
        home: /export/home/localadm
        hashedpassword: "$5$barfoo...."