2020-03-17 10:12:21 +00:00
|
|
|
# Fedora CoreOS
|
|
|
|
|
2021-07-15 07:00:48 +00:00
|
|
|
Tested with stable version 34.20210611.3.0
|
2020-04-11 06:51:47 +00:00
|
|
|
|
2020-03-17 10:12:21 +00:00
|
|
|
Because package installation with `rpm-ostree` requires a reboot, playbook may fail while bootstrap.
|
|
|
|
Restart playbook again.
|
|
|
|
|
|
|
|
## Containers
|
|
|
|
|
|
|
|
Tested with
|
|
|
|
|
2021-07-15 07:00:48 +00:00
|
|
|
- containerd
|
2020-03-17 10:12:21 +00:00
|
|
|
- crio
|
|
|
|
|
2020-04-11 06:51:47 +00:00
|
|
|
## Network
|
|
|
|
|
|
|
|
### calico
|
|
|
|
|
|
|
|
To use calico create sysctl file with ignition:
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
files:
|
|
|
|
- path: /etc/sysctl.d/reverse-path-filter.conf
|
|
|
|
contents:
|
|
|
|
inline: |
|
|
|
|
net.ipv4.conf.all.rp_filter=1
|
|
|
|
```
|
|
|
|
|
2020-03-17 10:12:21 +00:00
|
|
|
## libvirt setup
|
|
|
|
|
|
|
|
### Prepare
|
|
|
|
|
2020-04-11 06:51:47 +00:00
|
|
|
Prepare ignition and serve via http (a.e. python -m http.server )
|
2020-03-17 10:12:21 +00:00
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"ignition": {
|
|
|
|
"version": "3.0.0"
|
|
|
|
},
|
|
|
|
|
|
|
|
"passwd": {
|
|
|
|
"users": [
|
|
|
|
{
|
2020-04-11 06:51:47 +00:00
|
|
|
"name": "ansibleUser",
|
2020-03-17 10:12:21 +00:00
|
|
|
"sshAuthorizedKeys": [
|
2020-04-11 06:51:47 +00:00
|
|
|
"ssh-rsa ..publickey.."
|
2020-03-17 10:12:21 +00:00
|
|
|
],
|
|
|
|
"groups": [ "wheel" ]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
### create guest
|
|
|
|
|
|
|
|
```shell script
|
2021-07-15 07:00:48 +00:00
|
|
|
machine_name=myfcos1
|
|
|
|
ignition_url=http://mywebserver/fcos.ign
|
|
|
|
|
|
|
|
fcos_version=34.20210611.3.0
|
2020-03-17 10:12:21 +00:00
|
|
|
kernel=https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/${fcos_version}/x86_64/fedora-coreos-${fcos_version}-live-kernel-x86_64
|
|
|
|
initrd=https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/${fcos_version}/x86_64/fedora-coreos-${fcos_version}-live-initramfs.x86_64.img
|
2021-07-15 07:00:48 +00:00
|
|
|
rootfs=https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/${fcos_version}/x86_64/fedora-coreos-${fcos_version}-live-rootfs.x86_64.img
|
|
|
|
kernel_args="console=ttyS0 coreos.live.rootfs_url=${rootfs} coreos.inst.install_dev=/dev/sda coreos.inst.stream=stable coreos.inst.ignition_url=${ignition_url}"
|
2020-03-17 10:12:21 +00:00
|
|
|
sudo virt-install --name ${machine_name} --ram 4048 --graphics=none --vcpus 2 --disk size=20 \
|
|
|
|
--network bridge=virbr0 \
|
|
|
|
--install kernel=${kernel},initrd=${initrd},kernel_args_overwrite=yes,kernel_args="${kernel_args}"
|
|
|
|
```
|