c3os configuration mechanism is all based on cloud-config file.
By default, c3os
reads in lexicographic order YAML cloud-config files in the /usr/local/cloud-config
and /oem
directories.
For instance, you should be able to see the configuration generated by the interactive-installer in the /oem/99_custom.yaml
config file.
This mechanism can be used to set and enable persistent configuration on boot.
Below you will find some examples on how to use the cloud-config mechanism to enable/disable specific features.
Copy the following file in /oem/100_zram.yaml
or /usr/local/cloud-config/100_zram.yaml
:
stages:
boot:
- name: "zram setup"
commands:
- modprobe zram
- echo lzo > /sys/block/zram0/comp_algorithm
- echo 1G > /sys/block/zram0/disksize
- mkswap --label zram0 /dev/zram0
- swapon --priority 100 /dev/zram0
name: "zfs setup"
This YAML will run the commands on boot enabling zram as swap.