-
Notifications
You must be signed in to change notification settings - Fork 0
/
host1-init.yaml
105 lines (99 loc) · 9.43 KB
/
host1-init.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Copyright (c) 2020 Tigera, Inc. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
package_update: true
packages:
- bird
- iptables-persistent
write_files:
- encoding: b64
content: IyEvYmluL3NoCgpbIC1mICIvZXRjL25ldHBsYW4vNTEtc3RhdGljLnlhbWwiIF0gJiYgZXhpdCAwCgp3aGlsZSBbICEgLWYgL2V0Yy9uZXRwbGFuLzUwLWNsb3VkLWluaXQueWFtbCBdOwpkbwogICAgICAgIHNsZWVwIDEKZG9uZQoKSUZBQ0U9JChncmVwICdzZXQtbmFtZTonIC9ldGMvbmV0cGxhbi81MC1jbG91ZC1pbml0LnlhbWwgfCB0ciAtZCBbOnNwYWNlOl0gfCBjdXQgLWYyIC1kJzonKQoKcHJpbnRmICduZXR3b3JrOlxuICBldGhlcm5ldHM6XG4gICAgJXM6XG4gICAgICBhZGRyZXNzZXM6IFsgMTk4LjE5LjE1LjI1NC8yMCBdXG4gIHZlcnNpb246IDInICRJRkFDRSB8IHRlZSAvZXRjL25ldHBsYW4vNTEtc3RhdGljLnlhbWwK
owner: root:root
path: /etc/dynamicaddress.sh
permissions: '0755'
- encoding: b64
content: IyEvYmluL2Jhc2gKCndoaWxlIFsgISAtZiAvaG9tZS91YnVudHUvLmt1YmUvY29uZmlnIF0KZG8KCXNsZWVwIDEKCWVjaG8gIldhaXRpbmcgdG8gc2NwIGZpbGUgZnJvbSBjb250cm9sLiIKCS91c3IvYmluL3NjcCAtaSAvaG9tZS91YnVudHUvLnNzaC9pZF9yc2EgLW8gU3RyaWN0SG9zdEtleUNoZWNraW5nPW5vIC1vIFVzZXJLbm93bkhvc3RzRmlsZT0vZGV2L251bGwgdWJ1bnR1QDE5OC4xOS4wLjE6L2V0Yy9yYW5jaGVyL2szcy9rM3MueWFtbCAvaG9tZS91YnVudHUvLmt1YmUvY29uZmlnCmRvbmUKCi91c3IvYmluL3NlZCAtaSAncy8xMjcuMC4wLjEvMTk4LjE5LjAuMS9nJyAvaG9tZS91YnVudHUvLmt1YmUvY29uZmlnCgplY2hvIEt1YmVjb25maWcgY29tcGxldGUuCgoK
owner: root:root
path: /etc/k3s-config.sh
permissions: '0755'
- encoding: b64
content: W1VuaXRdCkRlc2NyaXB0aW9uPUluc3RhbGwgazNzIGNvbmZpZwpBZnRlcj1uZXR3b3JrLW9ubGluZS50YXJnZXQKQ29uZGl0aW9uUGF0aEV4aXN0cz0hL2hvbWUvdWJ1bnR1Ly5rdWJlL2NvbmZpZwoKW1NlcnZpY2VdCkV4ZWNTdGFydD0vYmluL3NoIC1jIC9ldGMvazNzLWNvbmZpZy5zaAoKW0luc3RhbGxdCldhbnRlZEJ5ID0gbXVsdGktdXNlci50YXJnZXQK
owner: root:root
path: /etc/systemd/system/k3s-config.service
permissions: '0644'
- encoding: b64
content: bG9nIHN0ZGVyciBhbGw7Cgpyb3V0ZXIgaWQgMTk4LjE5LjE1LjI1NDsKCnByb3RvY29sIGRldmljZSB7CiAgc2NhbiB0aW1lIDI7ICAgICMgU2NhbiBpbnRlcmZhY2VzIGV2ZXJ5IDIgc2Vjb25kcwp9Cgpwcm90b2NvbCBrZXJuZWwgewogIGxlYXJ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I7CiAgbXVsdGlob3A7CiAgZXhwb3J0IG5vbmU7CiAgZ3JhY2VmdWwgcmVzdGFydDsKICBpbXBvcnQgZmlsdGVyIGJncF9hbGxvdzsKICBhZGQgcGF0aHMgb247Cn0KcHJvdG9jb2wgYmdwICdOb2RlMicgewogIGRlc2NyaXB0aW9uICJDb25uZWN0aW9uIHRvIE5vZGUyIjsKICBsb2NhbCBhcyA2NDUxMjsKICBuZWlnaGJvciAxOTguMTkuMC4zIGFzIDY0NTEyOwogIG11bHRpaG9wOwogIGV4cG9ydCBub25lOwogIGdyYWNlZnVsIHJlc3RhcnQ7CiAgaW1wb3J0IGZpbHRlciBiZ3BfYWxsb3c7CiAgYWRkIHBhdGhzIG9uOwp9CgoK
owner: root:root
path: /etc/bird/bird.conf
permissions: '0644'
- encoding: b64
content: ZXhwb3J0IEtVQkVDT05GSUc9L2hvbWUvdWJ1bnR1Ly5rdWJlL2NvbmZpZwpleHBvcnQgREFUQVNUT1JFX1RZUEU9a3ViZXJuZXRlcwoK
owner: root:root
path: /etc/skel/.bash_aliases
permissions: '0644'
- encoding: b64
content: CjE5OC4xOS4wLjEgY29udHJvbAoxOTguMTkuMC4yIG5vZGUxCjE5OC4xOS4wLjMgbm9kZTIKMTk4LjE5LjE1LjI1NCBob3N0MQoK
owner: root:root
path: /etc/cloud/templates/hosts.debian.tmpl
append: true
- encoding: b64
content: IyEvYmluL2Jhc2gKQVJDSD1gdW5hbWUgLW1gCmlmIFtbICRBUkNIID09ICJ4ODZfNjQiIF1dCnRoZW4KL3Vzci9iaW4vY3VybCAtbyAvdXNyL2Jpbi9rdWJlY3RsIC1MIGh0dHBzOi8vc3RvcmFnZS5nb29nbGVhcGlzLmNvbS9rdWJlcm5ldGVzLXJlbGVhc2UvcmVsZWFzZS92MS4yNS4wL2Jpbi9saW51eC9hbWQ2NC9rdWJlY3RsCi91c3IvYmluL2NobW9kICt4IC91c3IvYmluL2t1YmVjdGwKL3Vzci9iaW4vY3VybCAtbyAvdXNy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ZXJpZnkKZmkKL3Vzci9iaW4vZWNobyBhbGlhcyBjYWxpY29jdGw9IidjYWxpY29jdGwgLS1hbGxvdy12ZXJzaW9uLW1pc21hdGNoJyIgPj4gL2V0Yy9wcm9maWxlCg==
owner: root:root
path: /root/bin_downloader.sh
permissions: '0644'
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCvW2dRLu0PLQeQ5q5X76RaPvh8/lhhTzucdOizgzJfbUClve4KVCivtB1/S0rX6uuZL6TZhtRDrB1bVGAkwnt6zTT/irQ1ly1AseLAGIdA+03ikQ4gD1hL+MPURko4O9qWyDpBzPtjinRkXYTPdDe3g5jj1CZMI8uw+oOwdxf/9efeEfiQZ+pZuqgtEJttxWx3NrLqiyZhiciSVoRxyXkOltMdovzNeeeRB0KkFKhjSWhjTW0QRJ19ZsDtH3lxChQd7YFfTtYL0oe3ZkRINzHwfr1vzTVaolWTF70H4LWFaTZpmFWZ+WmmXNriUHwov2TBsCYRMAJkM72PAi8WmtWR calico@cloud
ssh_keys:
rsa_private: |
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAr1tnUS7tDy0HkOauV++kWj74fP5YYU87nHTos4MyX21Apb3u
ClQor7Qdf0tK1+rrmS+k2YbUQ6wdW1RgJMJ7es00/4q0NZctQLHiwBiHQPtN4pEO
IA9YS/jD1EZKODvalsg6Qcz7Y4p0ZF2Ez3Q3t4OY49QmTCPLsPqDsHcX//Xn3hH4
kGfqWbqoLRCbbcVsdzay6osmYYnIklaEccl5DpbTHaL8zXnnkQdCpBSoY0loY01t
EESdfWbA7R95cQoUHe2BX07WC9KHt2ZESDcx8H69b801WqJVkxe9B+C1hWk2aZhV
mflpplza4lB8KL9kwbAmETACZDO9jwIvFprVkQIDAQABAoIBAGGevNGREh+UrdWY
1g3WNuSWkbbj0Ue62DCtVK46p1xAcfDS3yWY3F2UI6etvqic+zN4NolyadCSjHU/
b5aHPj6K5qosCU6cLnEJlnXiMcmXHT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g0B8
56E90uQJS9aJ/qVZiubWiZpFuIX2tqjulqpp9aN3NbA/Uv8YJa78
-----END RSA PRIVATE KEY-----
rsa_public: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCvW2dRLu0PLQeQ5q5X76RaPvh8/lhhTzucdOizgzJfbUClve4KVCivtB1/S0rX6uuZL6TZhtRDrB1bVGAkwnt6zTT/irQ1ly1AseLAGIdA+03ikQ4gD1hL+MPURko4O9qWyDpBzPtjinRkXYTPdDe3g5jj1CZMI8uw+oOwdxf/9efeEfiQZ+pZuqgtEJttxWx3NrLqiyZhiciSVoRxyXkOltMdovzNeeeRB0KkFKhjSWhjTW0QRJ19ZsDtH3lxChQd7YFfTtYL0oe3ZkRINzHwfr1vzTVaolWTF70H4LWFaTZpmFWZ+WmmXNriUHwov2TBsCYRMAJkM72PAi8WmtWR calico@cloud
bootcmd:
- [ /usr/sbin/iptables, -t, mangle, -A, POSTROUTING, -p, tcp, --tcp-flags, 'SYN,RST', SYN, -j, TCPMSS, --set-mss, 1300 ]
- [ /usr/sbin/ip6tables, -t, mangle, -A, POSTROUTING, -p, tcp, --tcp-flags, 'SYN,RST', SYN, -j, TCPMSS, --set-mss, 1300 ]
runcmd:
- [ /usr/bin/cloud-init, single, --name, cc_write_files, --frequency, always ]
- [ /usr/bin/sh, -c, /etc/dynamicaddress.sh ]
- [ /usr/bin/systemctl, enable, NetworkManager-wait-online.service ]
- [ /usr/bin/cp, -Ra, /etc/ssh/ssh_host_rsa_key, /home/ubuntu/.ssh/id_rsa ]
- [ /usr/bin/cp, -Ra, /etc/ssh/ssh_host_rsa_key.pub, /home/ubuntu/.ssh/id_rsa.pub ]
- [ /usr/bin/chown, -R, ubuntu:ubuntu, /home/ubuntu/.ssh ]
- [ /usr/bin/mkdir, /home/ubuntu/.kube ]
- [ /usr/bin/chmod, +x, /root/bin_downloader.sh ]
- [ /root/bin_downloader.sh ]
- [ /usr/bin/chown, -R, ubuntu:ubuntu, /home/ubuntu ]
- [ /usr/bin/systemctl, enable, k3s-config.service ]
power_state:
mode: reboot