This repository has been archived by the owner on Jun 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
92 lines (86 loc) · 3.98 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
dist: xenial
sudo: required
rvm:
- 2.6
env:
# - distribution: centos
# version: 8
# suite: default
- distribution: ubuntu
version: 20.04
suite: default
- distribution: ubuntu
version: 18.04
suite: default
ANSIBLE_EXTRA_FLAGS: "'-e ANSIBLE_SKIP_CONFLICT_CHECK=1'"
before_install:
- env
- pwd
- find -ls
## use appropriate role path and not github name
- "[ -f get-dependencies.sh ] && sh -x get-dependencies.sh"
- echo "deb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse" | sudo tee /etc/apt/sources.list.d/xenial-backports.list
- sudo apt-get update -qq
- sudo apt -t xenial-backports -y install lxd acl dnsmasq-base zfsutils-linux -q
## change of group implies logout+login to apply... can't do with travis = run as root (sic)
## https://github.com/travis-ci/travis-ci/issues/1839 or chain: sudo -E su $USER -c "..."
- sudo usermod -G lxd travis
# Pull container
# - lxc remote add images images.linuxcontainers.org
- sudo -E su $USER -c "lxc remote list"
- sudo -E su $USER -c "lxc image list"
## pre-download base images
- 'sudo -E su $USER -c "[ ${distribution} == ubuntu ] || lxc image copy images:${distribution}/${version}/amd64 local: --alias=${distribution}-${version}-nossh"'
- 'sudo -E su $USER -c "[ ${distribution} == ubuntu ] && lxc image copy ubuntu:${version} local: --alias=${distribution}-${version}" || true'
## configure network
- ifconfig -a
- sudo lxc info
- sudo lxc network list
- sudo lxc network create lxdbr0
- sudo lxc network show lxdbr0
- sudo lxc network attach-profile lxdbr0 default ens4
- sudo lxc profile device get default ens4 nictype || true
- sudo service lxd restart
- ps ax | grep dnsmasq
- systemctl status -l --no-pager lxd || true
- cat /etc/network/interfaces.d/50-cloud-init.cfg
- sudo lxc network list
# configure storage pool
- sudo lxc storage list
- sudo lxc storage create pool1 zfs
- sudo lxc storage list
- sudo zpool list
- sudo lxc profile device add default root disk path=/ pool=pool1
- sudo lxc profile show default
# https://redis4you.com/articles.php?id=012&name=redis
# https://vincent.bernat.ch/en/blog/2014-tcp-time-wait-state-linux
- sudo sysctl -w net.ipv4.tcp_timestamps=1
- sudo pip install ansible ansible-lint
- gem install test-kitchen --version "=1.25.0"
- gem install kitchen-ansible
- gem install kitchen-sync
- gem install kitchen-lxd_cli
- gem list
- which kitchen
## ssh key for lxd_cli ?
- ls ~/.ssh
- ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa -P ""
## sudo/su get us a non-usual PATH ...
- '[ "X${distribution}" == "Xcentos" ] && sudo -E su $USER -c "sh -x ./test/lxd/centos-ssh-image.sh ${version}" || true'
- sudo -E su $USER -c "env"
- sudo -E su $USER -c "env PATH=$PATH kitchen diagnose --all"
script:
- ansible-lint tasks/main.yml || true
# - KITCHEN_LOCAL_YAML=.kitchen.local.yml bundle exec kitchen verify ${INSTANCE}
- sudo -E su $USER -c "env PATH=$PATH kitchen verify ${suite}-${distribution}-${version//./} -l debug || (cat $HOME/.kitchen/logs/${suite}-${distribution}-${version//./}.log; find /tmp/kitchen)"
after_script:
- sudo -E su $USER -c "env PATH=$PATH kitchen exec ${suite}-${distribution}-${version//./} -c 'cat /tmp/idempotency.test'"
- sudo -E su $USER -c "env PATH=$PATH kitchen exec ${suite}-${distribution}-${version//./} -c 'ps axuw'"
- sudo -E su $USER -c "env PATH=$PATH kitchen exec ${suite}-${distribution}-${version//./} -c 'netstat -anp'"
- sudo -E su $USER -c "env PATH=$PATH kitchen exec ${suite}-${distribution}-${version//./} -c 'ss -nlp'"
- sudo -E su $USER -c "env PATH=$PATH kitchen exec ${suite}-${distribution}-${version//./} -c 'systemctl -l --no-pager status'"
- sudo -E su $USER -c "env PATH=$PATH kitchen exec ${suite}-${distribution}-${version//./} -c 'journalctl -xe --no-pager'"
- sudo -E su $USER -c "env PATH=$PATH kitchen destroy ${suite}-${distribution}-${version//./}"
notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/