Skip to content

Merge pull request #368 from moonlies/master #220

Merge pull request #368 from moonlies/master

Merge pull request #368 from moonlies/master #220

---
name: 'Ansible Deployment Test'
on:
push:
branches:
- 'bbb/2.5'
- 'bbb/2.6'
- 'master'
- 'main'
- 'develop'
tags:
- ".*"
pull_request:
types: [opened, reopened]
jobs:
build:
runs-on: ${{ matrix.distribution }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
include:
- distribution: 'ubuntu-20.04'
experimental: false
env:
ANSIBLE_CALLBACK_ENABLED: profile_tasks
ANSIBLE_EXTRA_VARS: "-e bbb_freeswitch_socket_password='SuperSecurePassword-123456789'"
ROLEPATH: ebbba.bigbluebutton
steps:
- uses: actions/checkout@v2
with:
path: ebbba.bigbluebutton
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install ansible-lint flake8 yamllint
which ansible
pip3 install ansible
pip3 show ansible
ls -l $HOME/.local/bin || true
ls -l /opt/hostedtoolcache/Python/3.9.1/x64/bin || true
echo "/opt/hostedtoolcache/Python/3.9.1/x64/bin" >> $GITHUB_PATH
ansible --version
cd $GITHUB_WORKSPACE/${{ env.ROLEPATH }}
{ echo '[defaults]'; echo 'callback_enabled = profile_tasks, timer'; echo 'roles_path = ../'; echo 'ansible_python_interpreter: /usr/bin/python3'; } >> ansible.cfg
{ echo '[bbb]'; echo 'localhost ansible_connection=local'; } > inventory
ansible-galaxy install -r requirements.yml
- name: Environment
run: |
pwd
env
find -ls
- name: run test
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
run: |
cd $GITHUB_WORKSPACE/${{ env.ROLEPATH }} && ansible-playbook -i inventory --become -vvv test/integration/default/default.yml ${ANSIBLE_EXTRA_VARS}
- name: idempotency run
run: |
cd $GITHUB_WORKSPACE/${{ env.ROLEPATH }} && ansible-playbook -i inventory --become -vvv test/integration/default/default.yml ${ANSIBLE_EXTRA_VARS} | tee /tmp/idempotency.log | grep -q 'changed=0.*failed=0' && (echo 'Idempotence test: pass' && exit 0) || (echo 'Idempotence test: fail' && cat /tmp/idempotency.log && exit 0)
- name: verify
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
run: |
cd $GITHUB_WORKSPACE/${{ env.ROLEPATH }} && ansible-playbook -i inventory --become -v molecule/default/verify.yml ${ANSIBLE_EXTRA_VARS}
- name: On failure
if: ${{ failure() }}
continue-on-error: true
run: |
systemctl --full --no-pager status
systemctl --full --no-pager --failed
ls -l /usr/bin/ | egrep '(python|pip|ansible)'
pip freeze
pip3 freeze
ip addr
cat /etc/resolv.conf
host www.google.com || true
ping -c 1 www.google.com || true
ping -c 1 8.8.8.8 || true
host ubuntu.bigbluebutton.org || true
dig ubuntu.bigbluebutton.org || true
dig @1.1.1.1 ubuntu.bigbluebutton.org || true
curl --verbose https://ubuntu.bigbluebutton.org/repo/bigbluebutton.asc || true
- name: After script - ansible setup
if: ${{ always() }}
continue-on-error: true
run: |
ansible --inventory inventory --connection=local --module-name setup localhost
- name: After script - firewall
if: ${{ always() }}
continue-on-error: true
run: |
sudo iptables --list --verbose --numeric
sudo ip6tables --list --verbose --numeric
sudo ufw status verbose
- name: After script - python
if: ${{ always() }}
continue-on-error: true
run: |
which pip
pip freeze
which pip3
pip3 freeze
- name: After script - sfiles
if: ${{ always() }}
continue-on-error: true
run: |
echo "*** mongo"
cat /etc/mongod.conf
sudo cat /var/log/mongodb/mongod.log || true
echo "*** etc"
find /etc/red5 /etc/bigbluebutton/ -type f -ls
- name: After script - curl
if: ${{ always() }}
continue-on-error: true
run: |
curl --verbose http://localhost
curl --verbose --insecure https://localhost
curl --verbose --insecure https://localhost/b/
curl --verbose --insecure https://localhost/check/
curl --verbose --insecure https://localhost/default.pdf
- name: After script - systemd-resolve
if: ${{ always() }}
continue-on-error: true
run: |
cat /etc/systemd/resolved.conf || true
sudo resolvectl status || true
sudo systemd-resolve --status || true
resolvectl query ubuntu.bigbluebutton.org || true
journalctl --unit systemd-resolved --no-pager
- name: After script - system
if: ${{ always() }}
continue-on-error: true
run: |
sudo netstat --tcp --udp --all --numeric --processes
sudo ss --numeric --listening --processes
systemctl --full --no-pager status nginx
systemctl --full --no-pager status mongod
systemctl --full --no-pager status freeswitch
systemctl --full --no-pager status
journalctl --catalog --pager-end --no-pager
- name: After script - bbb
if: ${{ always() }}
continue-on-error: true
run: |
sudo bbb-conf --status
sudo bbb-conf --check
sudo bbb-conf --secret