blob: 3839f937cd33958b77b1d3ad0429876cef24ac10 [file] [log] [blame]
sgudzf0ff0302018-01-29 18:50:01 +02001| # 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:
sgudzf0ff0302018-01-29 18:50:01 +020021 # 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 # Configure dhclient
29 - sudo echo "nameserver {gateway}" >> /etc/resolvconf/resolv.conf.d/base
30 - sudo resolvconf -u
31
32 # Enable grub menu using updated config below
33 - update-grub
34
35 # Prepare network connection
36 - sudo ifdown ens3
37 - sudo ip r d default || true # remove existing default route to get it from dhcp
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
sgudzf0ff0302018-01-29 18:50:01 +020047 - echo "nameserver 172.18.208.44" > /etc/resolv.conf;
Dennis Dmitriev5f71f9e2018-10-19 13:02:43 +030048
49 - mkdir -p /srv/salt/reclass/nodes
50 - systemctl enable salt-master
51 - systemctl enable salt-minion
52 - systemctl start salt-master
53 - systemctl start salt-minion
54 - salt-call -l info --timeout=120 test.ping
sgudzf0ff0302018-01-29 18:50:01 +020055
56 write_files:
57 - path: /etc/default/grub.d/97-enable-grub-menu.cfg
58 content: |
59 GRUB_RECORDFAIL_TIMEOUT=30
60 GRUB_TIMEOUT=3
61 GRUB_TIMEOUT_STYLE=menu
62
63 - path: /etc/network/interfaces
64 content: |
65 auto ens3
66 iface ens3 inet dhcp
67
68 - path: /root/.ssh/config
69 owner: root:root
70 permissions: '0600'
71 content: |
72 Host *
73 ServerAliveInterval 300
74 ServerAliveCountMax 10
75 StrictHostKeyChecking no
76 UserKnownHostsFile /dev/null