This repository has been archived by the owner on Dec 16, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloud-config-bootstrap.yml
96 lines (86 loc) · 2.98 KB
/
cloud-config-bootstrap.yml
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
#cloud-config
ssh_authorized_keys:
- ssh-rsa YOUR-KEY-HERE
hostname: initializing
write_files:
- path: /etc/starship.conf
permissions: 0644
owner: root
content: |
## STARSHIP CONFIGURATION SETTINGS ##
# LINK YOUR CLOUD CONFIG TEMPLATE HERE #
STARSHIP_TEMPLATE="https://gist.githubusercontent.com/..../cloud-config-template.yml"
# Specify the output file here, by default it uses /opt/cloud-config.yml
# You must ALSO change the location in the starship-cloudinit.service (last line of the bootstrap file)
#STARSHIP_OUTPUT="/opt/cloud-config.yml"
## EXTRA SETTINGS ##
# You may define any extra environment variables you want here that will be replaced in your Starship file
# For example:
# myvar=test
## END CONFIGURATION ##
## END EXTRA SETTINGS ##
- path: /opt/bin/install-starship
permissions: 0755
owner: root
content: |
#!/bin/bash
INSTALL_URL="https://raw.github.com/Shaped/Starship/master/bin/install-starship"
while [ ! -e /opt/bin/install-starship ]; do
wget -q -N -P /opt/bin $INSTALL_URL && chmod +x /opt/bin/install-starship
if [ ! -e /opt/bin/install-starship ]; then
echo Failed to install.. Retrying in 5 seconds.. ^C to quit.
sleep 5
else
echo install-starship installed successfully to /opt/bin
fi
done
- path: /etc/resolv.conf
permissions: 0644
owner: root
content: |
nameserver 8.8.8.8
nameserver 8.8.4.4
coreos:
units:
- name: install-starship.service
command: start
runtime: true
content: |
[Unit]
Requires=install-starship.service
After=install-starship.service
Description=Shaped HMSS Star Ship Installer
Documentation=starship.shaped.ca
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/opt/bin/init-starship
ExecStart=/opt/bin/install-starship
- name: starship-cloudinit.service
runtime: true
command: start
content: |
[Unit]
Description=Main StarShip service - processes a template for hand-off to coreos-cloudinit
Documentation=starship.shaped.ca
Requires=install-starship.service
After=install-starship.service
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/etc/starship.conf
ExecStart=/opt/bin/starship
- name: starship-cloudinit.service
runtime: true
command: start
content: |
[Unit]
Description=Re-initialize coreos-cloudinit with the StarShipped template
Documentation=starship.shaped.ca
Requires=starship.service
After=starship.service
[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/etc/environment
ExecStart=/usr/bin/coreos-cloudinit --from-file=/opt/cloud-config.yml