blob: e4a0299e9c031448fb706359a9557defc63408fd [file] [log] [blame]
Dennis Dmitrievb3b37492018-07-08 21:23:00 +03001| # All the data below will be stored as a string object
2 #cloud-config, see http://cloudinit.readthedocs.io/en/latest/topics/examples.html
3
4 ssh_pwauth: True
5 users:
6 - name: root
7 sudo: ALL=(ALL) NOPASSWD:ALL
8 shell: /bin/bash
9 ssh_authorized_keys:
10 {% for key in config.underlay.ssh_keys %}
11 - ssh-rsa {{ key['public'] }}
12 {% endfor %}
13
14 disable_root: false
15 chpasswd:
16 list: |
17 root:r00tme
18 expire: False
19
Dennis Dmitriev752c1bf2018-12-19 13:05:16 +020020
Dennis Dmitrievb3b37492018-07-08 21:23:00 +030021 bootcmd:
22 # Enable root access
23 - sed -i -e '/^PermitRootLogin/s/^.*$/PermitRootLogin yes/' /etc/ssh/sshd_config
24 - service sshd restart
25 output:
26 all: '| tee -a /var/log/cloud-init-output.log /dev/tty0'
27
28 runcmd:
Dennis Dmitriev752c1bf2018-12-19 13:05:16 +020029 - if lvs vg0; then pvresize /dev/vda3; fi
30 - if lvs vg0; then /usr/bin/growlvm.py --image-layout-file /usr/share/growlvm/image-layout.yml; fi
31
Dennis Dmitrievb3b37492018-07-08 21:23:00 +030032 - export TERM=linux
33 - export LANG=C
34 # Configure dhclient
35 - sudo echo "nameserver {gateway}" >> /etc/resolvconf/resolv.conf.d/base
36 - sudo resolvconf -u
37
38 # Enable grub menu using updated config below
39 - update-grub
40
41 # Prepare network connection
42 - sudo ifup ens3
43 #- sudo route add default gw {gateway} {interface_name}
44
45 # Create swap
46 - fallocate -l 16G /swapfile
47 - chmod 600 /swapfile
48 - mkswap /swapfile
49 - swapon /swapfile
50 - echo "/swapfile none swap defaults 0 0" >> /etc/fstab
51
52 write_files:
53 - path: /etc/default/grub.d/97-enable-grub-menu.cfg
54 content: |
55 GRUB_RECORDFAIL_TIMEOUT=30
56 GRUB_TIMEOUT=3
57 GRUB_TIMEOUT_STYLE=menu
58
59 - path: /etc/network/interfaces
60 content: |
61 auto ens3
62 iface ens3 inet dhcp
63
Dennis Dmitriev752c1bf2018-12-19 13:05:16 +020064 - path: /usr/share/growlvm/image-layout.yml
65 content: |
66 root:
67 size: '50%VG'
68 home:
69 size: '100M'
70 var_log:
71 size: '15%VG'
72 var_log_audit:
73 size: '500M'
74 var_tmp:
75 size: '500M'
76 tmp:
77 size: '500M'
78 owner: root:root
79
80 growpart:
81 mode: auto
82 devices:
83 - '/'
84 - '/dev/vda3'
85 ignore_growroot_disabled: false