lueschem / edi

Embedded development infrastructure.
https://www.get-edi.io
GNU Lesser General Public License v3.0
38 stars 12 forks source link

Make edi available on Debian #36

Closed lueschem closed 5 years ago

lueschem commented 6 years ago

Issue Type

Environment detail

> cat /etc/os-release
> python3 --version
> ansible-playbook --version
> lxc --version
> dpkg -l | grep "\(lxd\|ansible\)"
> EOF
+ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
+ python3 --version
Python 3.5.3
+ ansible-playbook --version
ansible-playbook 2.2.1.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
+ lxc --version
3.2
+ dpkg -l
+ grep \(lxd\|ansible\)
ii  ansible                          2.2.1.0-2                      all          Configuration management, deployment, and task execution system

Desired Behavior

edi should work smoothly on Debian stretch as long as the LXD snap is installed.

Actual Behavior

How to reproduce:

sudo apt install snapd
sudo snap install lxd
source /etc/profile.d/apps-bin-path.sh
sudo usermod -a -G lxd $USER
lxd init
sudo apt install git
git clone https://github.com/lueschem/edi.git
cd edi
sudo apt install -y git-buildpackage dh-make equivs && sudo mk-build-deps -i debian/control
sudo visudo --> add /snap/bin to secure_path
debuild -us -uc

Following fixes were needed:

lueschem commented 5 years ago

Additional fixup needed: lxc executable is not in path when calling sudo edi (without sudo it works):

INFO:root:Running command: ['sudo', '-u', 'pi', 'ansible-playbook', '--connection', 'lxd', '--inventory', '/home/pi/edi-arm64/tmp9367q2uu/inventory', '--extra-vars', '@/home/pi/edi-arm64/tmp9367q2uu/extra_vars_100_base_system', '/home/pi/edi/edi/plugins/playbooks/debian/base_system/main.yml']

PLAY [edi] *****

TASK [setup] *** fatal: [pytest-N10EEE]: FAILED! => {"failed": true, "msg": "lxc command not found in PATH"} to retry, use: --limit @/home/pi/edi/edi/plugins/playbooks/debian/base_system/main.retry

PLAY RECAP ***** pytest-N10EEE : ok=0 changed=0 unreachable=0 failed=1

Error: Command '['sudo', '-u', 'pi', 'ansible-playbook', '--connection', 'lxd', '--inventory', '/home/pi/edi-arm64/tmp9367q2uu/inventory', '--extra-vars', '@/home/pi/edi-arm64/tmp9367q2uu/extra_vars_100_base_system', '/home/pi/edi/edi/plugins/playbooks/debian/base_system/main.yml']' returned non-zero exit status 2 For more information increase the log level.

lueschem commented 5 years ago

Another thing to fix:

/var/lib/dpkg/info/edi.postinst: 6: /var/lib/dpkg/info/edi.postinst: cannot create /etc/bash_completion.d/edi: Directory nonexistent dpkg: error processing package edi (--configure): subprocess installed post-installation script returned error exit status 2 Processing triggers for systemd (232-25+deb9u4) ... Errors were encountered while processing: edi E: Sub-process /usr/bin/dpkg returned an error code (1)