blob: 006a798fd201e008e1e3af32a54e102d0000acd0 [file] [log] [blame]
Dennis Dmitrievf5f2e602017-11-03 15:36:19 +02001#cloud-config, see http://cloudinit.readthedocs.io/en/latest/topics/examples.html
Tatyana Leontovichf3718442018-10-31 13:36:13 +02002
Dennis Dmitrievf5f2e602017-11-03 15:36:19 +02003ssh_pwauth: True
4users:
5 - name: root
6 sudo: ALL=(ALL) NOPASSWD:ALL
7 shell: /bin/bash
Tatyana Leontovichf3718442018-10-31 13:36:13 +02008
Dennis Dmitrievf5f2e602017-11-03 15:36:19 +02009disable_root: false
10chpasswd:
11 list: |
Tatyana Leontovichf3718442018-10-31 13:36:13 +020012 root:r00tme
Dennis Dmitrievf5f2e602017-11-03 15:36:19 +020013 expire: False
Tatyana Leontovichf3718442018-10-31 13:36:13 +020014
Dennis Dmitrievf5f2e602017-11-03 15:36:19 +020015bootcmd:
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'
Tatyana Leontovichf3718442018-10-31 13:36:13 +020021
Dennis Dmitrievf5f2e602017-11-03 15:36:19 +020022runcmd:
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
Dennis Dmitriev752c1bf2018-12-19 13:05:16 +020025
Dennis Dmitrievf5f2e602017-11-03 15:36:19 +020026 - export TERM=linux
27 - export LANG=C
28 # Configure dhclient
29 - sudo echo "nameserver {gateway}" >> /etc/resolvconf/resolv.conf.d/base
30 - sudo resolvconf -u
Tatyana Leontovichf3718442018-10-31 13:36:13 +020031
Dennis Dmitrievf5f2e602017-11-03 15:36:19 +020032 # Enable grub menu using updated config below
33 - update-grub
Tatyana Leontovichf3718442018-10-31 13:36:13 +020034
Dennis Dmitrievf5f2e602017-11-03 15:36:19 +020035 # Prepare network connection
36 - sudo ifup ens3
37 #- sudo route add default gw {gateway} {interface_name}
Tatyana Leontovichf3718442018-10-31 13:36:13 +020038
Dennis Dmitrievf5f2e602017-11-03 15:36:19 +020039 # Create swap
40 - fallocate -l 16G /swapfile
41 - chmod 600 /swapfile
42 - mkswap /swapfile
43 - swapon /swapfile
44 - echo "/swapfile none swap defaults 0 0" >> /etc/fstab
Tatyana Leontovichf3718442018-10-31 13:36:13 +020045
Dennis Dmitrievf5f2e602017-11-03 15:36:19 +020046write_files:
47 - path: /etc/default/grub.d/97-enable-grub-menu.cfg
48 content: |
49 GRUB_RECORDFAIL_TIMEOUT=30
50 GRUB_TIMEOUT=3
51 GRUB_TIMEOUT_STYLE=menu
Tatyana Leontovichf3718442018-10-31 13:36:13 +020052
Dennis Dmitrievf5f2e602017-11-03 15:36:19 +020053 - path: /etc/network/interfaces
54 content: |
55 auto ens3
56 iface ens3 inet dhcp
Tatyana Leontovichf3718442018-10-31 13:36:13 +020057
Dennis Dmitrievf5f2e602017-11-03 15:36:19 +020058 - path: /usr/share/growlvm/image-layout.yml
59 content: |
60 root:
61 size: '30%VG'
62 home:
63 size: '1G'
64 var_log:
65 size: '11%VG'
66 var_log_audit:
67 size: '5G'
68 var_tmp:
69 size: '11%VG'
70 tmp:
71 size: '5G'
72 owner: root:root
Dennis Dmitriev752c1bf2018-12-19 13:05:16 +020073
Dennis Dmitrievf5f2e602017-11-03 15:36:19 +020074growpart:
75 mode: auto
76 devices:
77 - '/'
78 - '/dev/vda3'
79 ignore_growroot_disabled: false