blob: fd1527a5f4fcded76e03d43dc49033d89c37896a [file] [log] [blame]
Oleksii Butenko87d00c02018-09-05 19:11:17 +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
20 bootcmd:
21 # Enable root access
22 - sed -i -e '/^PermitRootLogin/s/^.*$/PermitRootLogin yes/' /etc/ssh/sshd_config
23 - service sshd restart
24 output:
25 all: '| tee -a /var/log/cloud-init-output.log /dev/tty0'
26
27 runcmd:
Dennis Dmitriev752c1bf2018-12-19 13:05:16 +020028 - if lvs vg0; then pvresize /dev/vda3; fi
29 - if lvs vg0; then /usr/bin/growlvm.py --image-layout-file /usr/share/growlvm/image-layout.yml; fi
30
Oleksii Butenko87d00c02018-09-05 19:11:17 +030031 - export TERM=linux
32 - export LANG=C
33 # Configure dhclient
34 - sudo echo "nameserver {gateway}" >> /etc/resolvconf/resolv.conf.d/base
35 - sudo resolvconf -u
36
37 # Prepare network connection
38 - sudo ifup ens3
39 #- sudo route add default gw {gateway} {interface_name}
40
41 # Create swap
42 - fallocate -l 4G /swapfile
43 - chmod 600 /swapfile
44 - mkswap /swapfile
45 - swapon /swapfile
46 - echo "/swapfile none swap defaults 0 0" >> /etc/fstab
47
48 write_files:
49 - path: /etc/network/interfaces
50 content: |
51 auto ens3
52 iface ens3 inet dhcp
53
Dennis Dmitriev752c1bf2018-12-19 13:05:16 +020054 - path: /usr/share/growlvm/image-layout.yml
55 content: |
56 root:
Dennis Dmitrievc79f2282019-01-21 13:52:19 +020057 size: '30%VG'
Dennis Dmitriev752c1bf2018-12-19 13:05:16 +020058 home:
Dennis Dmitrievc79f2282019-01-21 13:52:19 +020059 size: '1G'
Dennis Dmitriev752c1bf2018-12-19 13:05:16 +020060 var_log:
Dennis Dmitrievc79f2282019-01-21 13:52:19 +020061 size: '11%VG'
Dennis Dmitriev752c1bf2018-12-19 13:05:16 +020062 var_log_audit:
Dennis Dmitrievc79f2282019-01-21 13:52:19 +020063 size: '5G'
Dennis Dmitriev752c1bf2018-12-19 13:05:16 +020064 var_tmp:
Dennis Dmitrievc79f2282019-01-21 13:52:19 +020065 size: '11%VG'
Dennis Dmitriev752c1bf2018-12-19 13:05:16 +020066 tmp:
Dennis Dmitrievc79f2282019-01-21 13:52:19 +020067 size: '5G'
Dennis Dmitriev752c1bf2018-12-19 13:05:16 +020068 owner: root:root
69
70 growpart:
71 mode: auto
72 devices:
73 - '/'
74 - '/dev/vda3'
75 ignore_growroot_disabled: false