mirror of
https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git
synced 2025-12-16 03:42:44 +03:00
Describe different user-data file formats
This commit is contained in:
parent
158592eacf
commit
abd60792ae
@ -1,8 +1,22 @@
|
|||||||
# Modules That Tiny-Cloud Supports
|
# User Data
|
||||||
|
|
||||||
The `user-data` file is used to configure Alpine linux state at the boot time. It supports a variety of modules that can be used to install packages, configure users and groups, and more. Tiny-cloud supports following modules:
|
User-data file is loaded during early stage. Location of this file defined by kernel paramter: `ds=<provider>;s=<path>`. For example for nocloud provider: `ds=nocloud;s=http://my.miniserve.instance/tinycloud/` tiny cloud will search for a file with name "user-data" at http://my.miniserve.instance/tinycloud/ resource.
|
||||||
|
|
||||||
|
Tiny-Cloud currently supports several user-data types and you could use ONE of them:
|
||||||
|
|
||||||
|
- alpine-config
|
||||||
|
- cloud-config
|
||||||
|
- script
|
||||||
|
|
||||||
|
The `user-data` file is used to configure Alpine Linux state at the boot time. It supports a variety of modules that can be used to install packages, configure users and groups, and more.
|
||||||
|
|
||||||
|
## Alpine-Config Data Type
|
||||||
|
|
||||||
|
Alpine config Must have `#alpine-config` as fist line in the file.
|
||||||
|
Rest of the file is a yaml which describes several alpine-spesific configuration paramters:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
#alpine-config
|
||||||
apk:
|
apk:
|
||||||
cache: # path to apk cache where /etc/apk/cache link follows
|
cache: # path to apk cache where /etc/apk/cache link follows
|
||||||
repositories: # <map> defines resulted url https://dl-cdn.alpinelinux.org/alpine/edge/community
|
repositories: # <map> defines resulted url https://dl-cdn.alpinelinux.org/alpine/edge/community
|
||||||
@ -11,9 +25,22 @@ apk:
|
|||||||
repos: # <list>
|
repos: # <list>
|
||||||
- community
|
- community
|
||||||
|
|
||||||
user: # <map> Sets default user
|
autoinstall: # [ true | false] install alpine on the biggest empty disk found in the system
|
||||||
|
```
|
||||||
|
|
||||||
|
## Cloud-Config Data Type
|
||||||
|
|
||||||
|
Alpine config Must have `#cloud-config` as fist line in the file.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
#cloud-config
|
||||||
|
user: # <map> sets default user
|
||||||
name: # <string>
|
name: # <string>
|
||||||
|
|
||||||
|
groups: # <list> groups for default user
|
||||||
|
- wheel
|
||||||
|
- admin
|
||||||
|
|
||||||
users: # <list>
|
users: # <list>
|
||||||
# first one become default user
|
# first one become default user
|
||||||
- name:
|
- name:
|
||||||
@ -25,10 +52,9 @@ users: # <list>
|
|||||||
no_create_home: # [ true | false ] do not create home directory for the user. Default: false
|
no_create_home: # [ true | false ] do not create home directory for the user. Default: false
|
||||||
lock_passwd: # reset password of the user
|
lock_passwd: # reset password of the user
|
||||||
ssh_authorized_keys: # <list>
|
ssh_authorized_keys: # <list>
|
||||||
groups: # <list>
|
groups: wheel,power # comma-separated list of groups for the user
|
||||||
- wheel
|
doas: # content of the /etc/doas.d/<name>.conf doas file
|
||||||
- power
|
-
|
||||||
doas: # content of the /etc/doas.d/<name> doas file
|
|
||||||
|
|
||||||
ssh_authorized_keys: # public key to be authorized as default user
|
ssh_authorized_keys: # public key to be authorized as default user
|
||||||
|
|
||||||
@ -53,8 +79,15 @@ package_upgrade: # if "true" runs `apk upgrade`
|
|||||||
packages: # <list>
|
packages: # <list>
|
||||||
- curl
|
- curl
|
||||||
- bash
|
- bash
|
||||||
|
```
|
||||||
groups: # <list>
|
|
||||||
- wheel
|
## Script Data Type
|
||||||
- admin
|
|
||||||
|
Scipt user-data could be used to run arbitrary user script at the system init. User-data file must have script executor specific shebang, started with `#!`
|
||||||
|
For example shell script:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "running custom script at init time"
|
||||||
```
|
```
|
||||||
Loading…
x
Reference in New Issue
Block a user