Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tips for very rapid installs & testing of IIAB + Asterisk/FreePBX (using Multipass VM's) #3589

Open
holta opened this issue May 21, 2023 · 1 comment

Comments

@holta
Copy link
Member

holta commented May 21, 2023

Must be arising from some sudden/recent upstream change(s) in Debian 11 or more likely Asterisk or FreePBX? [ IN FACT ansible-core 2.15.0 IS THE PROBLEM: ansible/ansible#80863 ] As Ansible freezes no matter which version of Ansible is attempted, even much older versions like ansible-core 2.13.8.

Thanks @EMG70 who is also investigating this bug already outlined in PR #3588:

image

Here is an iiab-pbx.yml script to help accelerate his Multipass testing of different ideas using EVOLVING PR #3588:

# https://cloudinit.readthedocs.io/en/latest/topics/examples.html

runcmd:
  - apt update
  - apt install git -y
  - mkdir /etc/iiab
  - curl https://raw.githubusercontent.com/iiab/iiab/master/vars/local_vars_unittest.yml > /etc/iiab/local_vars.yml
  - [sed, -i, 's/^pbx_install:.*/pbx_install: True/', /etc/iiab/local_vars.yml]
  - [sed, -i, 's/^pbx_enabled:.*/pbx_enabled: True/', /etc/iiab/local_vars.yml]
  - curl iiab.io/risky.txt | bash &

[ PR #3588 is a crutch to be avoided, as it papers over ansible-core 2.15.0's failure, so was removed from above line. ]

Create the above file on any Ubuntu machine where Multipass is installed (e.g. your Ubuntu 23.04 laptop) using:

sudo su -
nano iiab-pbx.yml

Save & quit! Then run everything:

multipass launch https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-amd64.qcow2 -n deb11 -m 2G -d 25G -c 2 --bridged --cloud-init iiab-pbx.yml && multipass shell deb11

Those who do not want to give the VM a 192.168.0.X-like IP address from your home router (thanks to Multipass's sometimes messy LXD networking arrangements) should avoid the --bridged flag above.

Either way, it should shell you into the new VM! And a minute or two later, you can monitor the ongoing IIAB + PBX installs by running this inside the VM:

sudo su -
cd /opt/iiab/iiab
tail -f iiab-install.log

If IIAB's install is interrupted for any reason, remember to restart it WITHOUT allowing reboots:

sudo iiab -r

Either way, remember to never reboot a Debian 11 VM with Multipass as there's a networking glitch that ironically prevents Debian 11 from rebooting (#3568 (comment)). RECAP: Above is a just a testing trick for extremely rapid/iterative testing — when quick testing results are needed — but never reboot the VM, just throw it away as soon as testing it is done!

Once we eventually get past Ansible freezing (PR #3588), please also test Asterisk and FreePBX with actual phones, using the IP address that can be obtained on the Multipass host machine as follows:

multipass info deb11

Finally, when you're done testing, delete and purge each VM:

multipass delete deb11 -p

Related QA automation tips using Multipass + cloud-init:

@holta
Copy link
Member Author

holta commented Sep 6, 2023

Here is an iiab-pbx.yml script to help accelerate his Multipass testing of different ideas using EVOLVING PR #3588:

Just FYI another approach for rapid-testing of IIAB is pr3631.yml here:

# https://cloudinit.readthedocs.io/en/latest/topics/examples.html

runcmd:
  - apt update
  - export DEBIAN_FRONTEND=noninteractive
  # ABOVE MITIGATES... emacs install BLOCKING ON postfix INTERACTIVE PROMPTING:
  - apt install git emacs -y
  - mkdir /etc/iiab
  - |
    cat >> /etc/iiab/local_vars.yml <<EOF
    nodered_install: True
    nodered_enabled: True
    kalite_install: False
    kalite_enabled: False
    kiwix_install: False
    kiwix_enabled: False
    osm_vector_maps_install: False
    awstats_install: False
    awstats_enabled: False
    matomo_install: False
    matomo_enabled: False
    captiveportal_install: False
    admin_console_install: False
    admin_console_enabled: False
    EOF
  - curl iiab.io/risky.txt | bash -s 3631 &

Everything can then be run/tested all-at-once using:

multipass launch 22.04 -n u2204 -m 2G -d 25G -c 2 --bridged --cloud-init pr3631.yml
multipass shell u2204
sudo tail -f /opt/iiab/iiab/iiab-install.log

Related:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant