2017-10-10 06:03:19 +00:00
language : python
2021-02-24 23:57:12 +00:00
python : 3.8 # "3.8" also works
2021-02-24 21:44:51 +00:00
dist : focal
2021-02-24 22:48:17 +00:00
2021-02-24 23:57:12 +00:00
addons :
apt :
sources :
- sourceline : ppa:ansible/ansible
packages :
2021-02-25 00:12:46 +00:00
# - python-pip # @arky had used this starting in 2018
2021-04-06 17:49:43 +00:00
- ansible-base # Install latest ansible-base e.g. 2.10.7+, similar to https://github.com/iiab/iiab/blob/master/scripts/ansible
2021-02-25 00:12:46 +00:00
# - python3-pymysql # These 7-or-8 packages are not needed during this very rapid --syntax-check
# - python3-psycopg2
# - python3-passlib
# - python3-pip
# - python3-setuptools
- python3-packaging # To avoid warning "packaging Python module unavailable; unable to validate collection..."
# - python3-venv
# - virtualenv
2021-02-24 22:48:17 +00:00
2021-02-24 21:57:40 +00:00
install :
2021-02-24 22:37:40 +00:00
# - scripts/ansible # See #2105: fails to install latest Ansible (& ~4 Ansible Collections from collections.yml) due to Travis VM's disk layout/perms being different
2021-02-24 22:12:27 +00:00
# - pip install ansible # SLOW/OVERWEIGHT: installs Ansible 3.0.0+ with ~80 Ansible Collections
2021-04-06 17:58:38 +00:00
# - pip install ansible-base # ALSO WORKS (FASTER THAN ALL ABOVE!) e.g. if the above addons: / apt: section is commented out. To install latest ansible-base e.g. 2.10.7+, similar to https://github.com/iiab/iiab/blob/master/scripts/ansible
# - pip3 install ansible-core # APRIL 2021: ansible-base is being renamed to ansible-core -- latest version number is listed at https://pypi.org/project/ansible-core/
2021-02-24 22:48:17 +00:00
- ansible-galaxy collection install -r collections.yml # Install ~4 Ansible Collections
- "{ echo 'roles_path = ./roles/'; } >> ansible.cfg" # Add correct roles_path to ansible.cfg, appending to https://github.com/iiab/iiab/blob/master/ansible.cfg
2021-02-25 01:28:57 +00:00
# - "{ echo '[defaults]'; echo 'roles_path = ./roles/'; } >> ansible.cfg" # 2021-02-24: suddenly no longer works, with the newer ansible-base install methods above (error arises due to '[defaults]' appearing twice)
2021-02-24 22:48:17 +00:00
# - cat ansible.cfg # UNCOMMENT TO VERIFY!
2021-02-25 00:23:34 +00:00
- apt -a list ansible-base # VERIFY ansible-base VERSIONS OFFERED BY apt
2021-02-24 22:48:17 +00:00
2017-10-10 06:03:19 +00:00
script :
2021-02-24 21:57:40 +00:00
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check