blob: a0ddfdd434b0bddc7f1f0c303ddd957ea6983f4b [file] [log] [blame]
Tatyana Leontovich1e063f02019-05-08 15:06:33 +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:
Denis Meltsaykin4b7e2cb2021-06-03 15:45:21 +020023 - if lvs vg0; then pvresize $(pvdisplay -C -S vg_name=vg0 -o pv_name --noheadings | tail -n1); fi
Tatyana Leontovich1e063f02019-05-08 15:06:33 +030024 - 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
38 # Create swap
Sergey Galkin8a384d22020-01-23 17:05:52 +040039 - fallocate -l 2G /swapfile
Tatyana Leontovich1e063f02019-05-08 15:06:33 +030040 - chmod 600 /swapfile
41 - mkswap /swapfile
42 - swapon /swapfile
43 - echo "/swapfile none swap defaults 0 0" >> /etc/fstab
44
45write_files:
46 - path: /etc/default/grub.d/97-enable-grub-menu.cfg
47 content: |
48 GRUB_RECORDFAIL_TIMEOUT=30
49 GRUB_TIMEOUT=3
50 GRUB_TIMEOUT_STYLE=menu
51
52 - path: /etc/network/interfaces
53 content: |
54 auto ens3
55 iface ens3 inet dhcp
56
57 - path: /usr/share/growlvm/image-layout.yml
58 content: |
59 root:
Pavel Glazov91577a72022-08-10 12:32:30 +040060 size: '45%VG'
Tatyana Leontovich1e063f02019-05-08 15:06:33 +030061 home:
62 size: '1%VG'
63 var_log:
Pavel Glazov91577a72022-08-10 12:32:30 +040064 size: '30%VG'
Tatyana Leontovich1e063f02019-05-08 15:06:33 +030065 var_log_audit:
66 size: '5%VG'
67 var_tmp:
68 size: '10%VG'
69 tmp:
70 size: '5%VG'
71 owner: root:root
72
73growpart:
74 mode: auto
75 devices:
76 - '/'
77 - '/dev/vda3'
Denis Meltsaykin4b7e2cb2021-06-03 15:45:21 +020078 - '/dev/vdb3'
79 - '/dev/vdc3'
80 - '/dev/vdd3'
Tatyana Leontovich1e063f02019-05-08 15:06:33 +030081 ignore_growroot_disabled: false