Fedora CoreOS

Tested with stable version 31.20200223.3.0.

Because package installation with rpm-ostree requires a reboot, playbook may fail while bootstrap. Restart playbook again.

Containers

Tested with

  • docker
  • crio

docker

OS base packages contains docker.

cri-o

To use cri-o disable docker service with ignition:

  1. #workaround, see https://github.com/coreos/fedora-coreos-tracker/issues/229
  2. systemd:
  3. units:
  4. - name: docker.service
  5. enabled: false
  6. contents: |
  7. [Unit]
  8. Description=disable docker
  9. [Service]
  10. [Install]
  11. WantedBy=multi-user.target

Network

calico

To use calico create sysctl file with ignition:

  1. files:
  2. - path: /etc/sysctl.d/reverse-path-filter.conf
  3. contents:
  4. inline: |
  5. net.ipv4.conf.all.rp_filter=1

libvirt setup

Prepare

Prepare ignition and serve via http (a.e. python -m http.server )

  1. {
  2. "ignition": {
  3. "version": "3.0.0"
  4. },
  5. "passwd": {
  6. "users": [
  7. {
  8. "name": "ansibleUser",
  9. "sshAuthorizedKeys": [
  10. "ssh-rsa ..publickey.."
  11. ],
  12. "groups": [ "wheel" ]
  13. }
  14. ]
  15. }
  16. }

create guest

  1. fcos_version=31.20200223.3.0
  2. kernel=https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/${fcos_version}/x86_64/fedora-coreos-${fcos_version}-live-kernel-x86_64
  3. initrd=https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/${fcos_version}/x86_64/fedora-coreos-${fcos_version}-live-initramfs.x86_64.img
  4. ignition_url=http://mywebserver/fcos.ign
  5. kernel_args="ip=dhcp rd.neednet=1 console=tty0 coreos.liveiso=/ console=ttyS0 coreos.inst.install_dev=/dev/sda coreos.inst.stream=stable coreos.inst.ignition_url=${ignition_url}"
  6. sudo virt-install --name ${machine_name} --ram 4048 --graphics=none --vcpus 2 --disk size=20 \
  7. --network bridge=virbr0 \
  8. --install kernel=${kernel},initrd=${initrd},kernel_args_overwrite=yes,kernel_args="${kernel_args}"