@@ -13,6 +13,7 @@
|
|||||||
* [Boot](#boot-1)
|
* [Boot](#boot-1)
|
||||||
* [Floating IP](#floating-ip)
|
* [Floating IP](#floating-ip)
|
||||||
* [Connect with ssh](#connect-with-ssh-1)
|
* [Connect with ssh](#connect-with-ssh-1)
|
||||||
|
* [Userdata](#userdata)
|
||||||
* [Bonus](#bonus)
|
* [Bonus](#bonus)
|
||||||
|
|
||||||
|
|
||||||
@@ -292,11 +293,33 @@ ssh debian@xxx.yyy.zzz.aaa # floating ip
|
|||||||
|
|
||||||
Q: what IP can you see on ens3 interface of the instance?
|
Q: what IP can you see on ens3 interface of the instance?
|
||||||
|
|
||||||
|
## Userdata
|
||||||
|
|
||||||
|
### Create a script
|
||||||
|
Create a file named `postinstall.sh` with this content:
|
||||||
|
```
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo "Hello from my instance" > /var/log/postinstall.log
|
||||||
|
```
|
||||||
|
|
||||||
|
### Start an instance
|
||||||
|
Figure out the command to start a new instance with this script as `user-data`.
|
||||||
|
|
||||||
|
Don't forget to start with your `keypair` so you can connect to it later
|
||||||
|
|
||||||
|
### Check the result
|
||||||
|
When the instance is booted, ssh into it and check the result of the file:
|
||||||
|
|
||||||
|
```
|
||||||
|
cat /var/log/postinstall.log
|
||||||
|
```
|
||||||
|
|
||||||
|
## demo-flask
|
||||||
|
|
||||||
|
Try to deploy `demo-flask` with a custom `user-data` script.
|
||||||
|
|
||||||
|
|
||||||
## Bonus
|
## Bonus
|
||||||
|
|
||||||
Try to deploy `demo-flask` with cloud-init
|
|
||||||
|
|
||||||
|
|
||||||
## Bonus 2
|
|
||||||
|
|
||||||
Take a look at the [skyline WebUI](http://skyline.54.36.119.253.xip.opensteak.fr) and try to boot another instance from there.
|
Take a look at the [skyline WebUI](http://skyline.54.36.119.253.xip.opensteak.fr) and try to boot another instance from there.
|
||||||
|
|||||||
Reference in New Issue
Block a user