blob: 8c1f248a82fe91aa29f7b4e362a225814d77a2f1 [file] [log] [blame]
sgudza133b8e2019-05-10 14:32:08 +03001#cloud-config, see http://cloudinit.readthedocs.io/en/latest/topics/examples.html
2
3ssh_pwauth: True
4users:
5 - name: root
6 sudo: ALL=(ALL) NOPASSWD:ALL
7 shell: /bin/bash
8
9disable_root: false
10chpasswd:
11 list: |
12 root:r00tme
13 expire: False
14
15bootcmd:
16 # Enable root access
17 - sed -i -e '/^PermitRootLogin/s/^.*$/PermitRootLogin yes/' /etc/ssh/sshd_config
18 - service sshd restart
19output:
20 all: '| tee -a /var/log/cloud-init-output.log /dev/tty0'
21
22runcmd:
23 - if lvs vg0; then pvresize /dev/vda3; fi
24 - if lvs vg0; then /usr/bin/growlvm.py --image-layout-file /usr/share/growlvm/image-layout.yml; fi
25
26 - export TERM=linux
27 - export LANG=C
28 # Configure dhclient
29 - sudo resolvconf -u
30 #- sudo echo "nameserver {gateway}" >> /etc/resolvconf/resolv.conf.d/base
31 # Enable grub menu using updated config below
32 - update-grub
33
34 # Prepare network connection
35 - sudo ifup ens3
36 #- sudo route add default gw {gateway} {interface_name}
37
38write_files:
39 - path: /etc/default/grub.d/97-enable-grub-menu.cfg
40 content: |
41 GRUB_RECORDFAIL_TIMEOUT=30
42 GRUB_TIMEOUT=3
43 GRUB_TIMEOUT_STYLE=menu
44
45 - path: /etc/network/interfaces
46 content: |
47 auto ens3
48 iface ens3 inet dhcp
49
50 - path: /usr/share/growlvm/image-layout.yml
51 content: |
52 root:
53 size: '65%VG'
54 home:
55 size: '1%VG'
56 var_log:
57 size: '10%VG'
58 var_log_audit:
59 size: '5%VG'
60 var_tmp:
61 size: '10%VG'
62 tmp:
63 size: '5%VG'
64 owner: root:root
65
66growpart:
67 mode: auto
68 devices:
69 - '/'
70 - '/dev/vda3'
71 ignore_growroot_disabled: false