Firecracker, do not use, it sucks

This commit is contained in:
Roberto Alsina 2024-06-26 17:38:28 -03:00
parent 81a0ce0248
commit 2552ada812
2 changed files with 59 additions and 1 deletions

View File

@ -0,0 +1,57 @@
# Setup Firecracker for VMs
- name: Firecracker
hosts: servers
become_method: ansible.builtin.sudo
become: true
tasks:
- name: Get firecracker
become: false
ansible.builtin.get_url:
url: https://github.com/firecracker-microvm/firecracker/releases/download/v1.7.0/firecracker-v1.7.0-aarch64.tgz
dest: ~ralsina/firecracker.tgz
mode: '0644'
- name: Get kernel
become: false
ansible.builtin.get_url:
url: https://s3.amazonaws.com/spec.ccfc.min/img/quickstart_guide/aarch64/kernels/vmlinux.bin
dest: ~ralsina/vmlinux.bin
mode: '0644'
- name: Get root image
become: false
ansible.builtin.get_url:
url: https://s3.amazonaws.com/spec.ccfc.min/img/quickstart_guide/aarch64/rootfs/bionic.rootfs.ext4
dest: ~ralsina/bionic.rootfs.ext4
mode: '0644'
- name: Unpack firecracker
become: false
ansible.builtin.unarchive:
src: ~ralsina/firecracker.tgz
dest: ~ralsina
remote_src: true
- name: Install firecracker
become: true
ansible.builtin.command:
cmd: mv /home/ralsina/release-v1.7.0-aarch64/firecracker-v1.7.0-aarch64 /usr/bin/firecracker
creates: /usr/bin/firecracker
- name: Setup systemd unit for firecracker
become: true
ansible.builtin.copy:
dest: /etc/systemd/system/firecracker.service
content: |
[Unit]
Description=Firecracker VM Manager
[Service]
Type=simple
ExecStart=/usr/bin/firecracker --api-sock /tmp/firecracker.socket
Restart=always
[Install]
WantedBy=default.target
mode: '0644'
- name: Start and enable service
become: true
ansible.builtin.service:
name: firecracker
state: started
enabled: true

View File

@ -3,4 +3,5 @@ pinky ansible_user=ralsina
rocky ansible_user=ralsina
[servers:vars]
ansible_connection=ssh
ansible_connection=ssh
ansible_python_interpreter=/usr/bin/python3