forem / selfhost

Selfhost your Forem Community on your own infrastructure 🎉
https://www.forem.com/get-started/
GNU Affero General Public License v3.0
1.45k stars 174 forks source link

fcos_extraction_location is not created before extracting into it #37

Open djuber opened 3 years ago

djuber commented 3 years ago

Describe the bug

When installing for QEMU/libvirt on linux.

The fcos_extraction_location defaults to "$HOME/.local/share/libvirt/images".

If this directory does not exist, the "Stat FCOS extract file" step does not fail (shows ok: [forem]), the Extract FCOS image with xz setup fails (because nothing creates the location if it does not exist)

TASK [fcos : Extract FCOS file to $HOME/.local/share/libvirt/images with xz] ****************************
fatal: [forem]: FAILED! => changed=true 
  cmd: xz --decompress -k /home/djuber/src/selfhost/playbooks/providers/images/fedora-coreos-34.20210725.3.0-qemu.x86_64.qcow2.xz -c > $HOME/.local/share/libvirt/images/fedora-coreos-34.20210725.3.0-qemu.x86_64.qcow2
  delta: '0:00:00.001628'
  end: '2021-08-20 11:05:44.692859'
  msg: non-zero return code
  rc: 2
  start: '2021-08-20 11:05:44.691231'
  stderr: '/bin/sh: 1: cannot create /home/djuber/.local/share/libvirt/images/fedora-coreos-34.20210725.3.0-qemu.x86_64.qcow2: Directory nonexistent'
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>

To Reproduce Steps to reproduce the behavior:

  1. rm -rf $HOME/.local/share/libvirt/images - if there is anything you care about in there, maybe mv instead of rm :)
  2. run the qemu install playbook ansible-playbook -i inventory/forem/setup.yml playbooks/providers/qemu.yml
  3. observe the failure on the above step

Expected behavior

The fcos_extract_location directory is checked for existence, and either an earlier error with instructions to create the directory, or automatic directory creation occurs when it's not there.

Screenshots If applicable, add screenshots to help explain your problem.

OS (please complete the following information):

Cloud Provider (please complete the following information):

ghost commented 1 year ago

Nice

ghost commented 1 year ago

Ok

0xSaltyHash commented 1 year ago

Yep I can confirm that this happened to me on Ubuntu 22.04 LTS