Skip to content

default-bare

default-bare #132

Workflow file for this run

---
name: default-bare
on:
push:
pull_request:
workflow_dispatch:
schedule: # run weekly, every Tuesday 03:00
- cron: '0 3 * * 2'
permissions: {}
jobs:
build:
permissions:
contents: read
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
max-parallel: 4
matrix:
include:
- os: ubuntu-22.04
experimental: false
- os: ubuntu-20.04
experimental: false
env:
ANSIBLE_CALLBACKS_ENABLED: profile_tasks
ANSIBLE_EXTRA_VARS: ""
steps:
- uses: actions/checkout@v4
with:
path: juju4.lxd
- name: Set up Python
uses: actions/setup-python@v4
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/juju4.lxd
[ -f get-dependencies.sh ] && sh -x get-dependencies.sh
{ echo '[defaults]'; echo 'callbacks_enabled = profile_tasks, timer'; echo 'roles_path = ../'; echo 'ansible_python_interpreter: /usr/bin/python3'; } >> ansible.cfg
- name: run test
run: |
cd $GITHUB_WORKSPACE/juju4.lxd && ansible-playbook -i localhost, --connection=local --become -vvv test/integration/default/default.yml ${ANSIBLE_EXTRA_VARS}
env:
PY_COLORS: '1'
ANSIBLE_FORCE_COLOR: '1'
- name: idempotency run
run: |
cd $GITHUB_WORKSPACE/juju4.lxd && ansible-playbook -i localhost, --connection=local --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: On failure
run: |
ansible -i inventory --connection=local -m setup localhost
systemctl -l --no-pager status
systemctl -l --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
ping -c 1 www.google.com
ping -c 1 8.8.8.8
ps axuw
netstat -anp
if: ${{ failure() }}
- name: After script - systemd
run: |
systemctl -l --no-pager status lxd || true
systemd-analyze --no-pager security || true
rsyslogd -v
if: ${{ always() }}
continue-on-error: true
- name: After script - sysctl
run: |
sysctl user
if: ${{ always() }}
continue-on-error: true
- name: After script - files
run: |
sudo ls -la /var/lib/lxd/disks/
sudo ls -la /var/lib/lxd/networks/
if: ${{ always() }}
continue-on-error: true
- name: After script - lxc
run: |
sudo lxc info
sudo lxc profile show default
sudo lxc storage list
sudo lxc network list
if: ${{ always() }}
continue-on-error: true
- name: After script - snap
run: |
if [ -x /usr/bin/snap ]; then
snap list
cat /var/snap/lxd/common/lxd/logs/lxd.log
fi
if: ${{ always() }}
continue-on-error: true