blob: 319c0070199c9f11c33bb1125f61b86b8374f307 [file] [log] [blame]
Dennis Dmitriev9dada8a2017-08-30 17:38:55 +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:
Dennis Dmitriev9dada8a2017-08-30 17:38:55 +030021 # 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:
28 - export TERM=linux
29 - export LANG=C
30 # Configure dhclient
31 - sudo echo "nameserver {gateway}" >> /etc/resolvconf/resolv.conf.d/base
32 - sudo resolvconf -u
33
Dennis Dmitriev910a8002017-08-31 14:53:47 +030034 # Enable grub menu using updated config below
35 - update-grub
36
Dennis Dmitriev9dada8a2017-08-30 17:38:55 +030037 # Prepare network connection
38 - sudo ifup ens3
39 #- sudo route add default gw {gateway} {interface_name}
Dennis Dmitriev9dada8a2017-08-30 17:38:55 +030040
41 # Create swap
Dennis Dmitrievc9f46972017-10-13 14:00:23 +030042 - fallocate -l 16G /swapfile
Dennis Dmitriev9dada8a2017-08-30 17:38:55 +030043 - chmod 600 /swapfile
44 - mkswap /swapfile
45 - swapon /swapfile
46 - echo "/swapfile none swap defaults 0 0" >> /etc/fstab
47
Dennis Dmitriev9dada8a2017-08-30 17:38:55 +030048 write_files:
Dennis Dmitriev910a8002017-08-31 14:53:47 +030049 - path: /etc/default/grub.d/97-enable-grub-menu.cfg
50 content: |
51 GRUB_RECORDFAIL_TIMEOUT=30
52 GRUB_TIMEOUT=3
53 GRUB_TIMEOUT_STYLE=menu
54
Dennis Dmitriev9dada8a2017-08-30 17:38:55 +030055 - path: /etc/network/interfaces
56 content: |
57 auto ens3
58 iface ens3 inet dhcp
Dennis Dmitriev9dada8a2017-08-30 17:38:55 +030059