kolla-ansible/tests/post.yml
Mark Goddard 3dd6834a61 CI: fix kolla-ansible installation after cryptography 3.4 release
Installing kolla-ansible system-wide on CentOS 8 fails with:

    ModuleNotFoundError: No module named 'setuptools_rust'

This error appeared following the release of cryptography 3.4, which now
includes Rust code. It can be installed without Rust using a Python
wheel, but only with more recent pip than version 9.0.3 available as RPM
on CentOS 8. The cryptography bug report [1] recommends pip>=19.1.1.

This change switches to using pip --user when installing kolla-ansible.

Also fixes an issue with ansible-lint which was failing on
etc/kolla/globals.yml due to a missing space before comments.

[1] https://github.com/pyca/cryptography/issues/5753

Change-Id: Ifaf1948ed5d42eebaa62d7bad375bbfc12b134d5
Closes-Bug: #1915141
2021-02-10 22:01:40 +01:00

88 lines
2.7 KiB
YAML

---
- hosts: all
vars:
logs_dir: "/tmp/logs"
tasks:
- name: Print all facts
copy:
content: "{{ hostvars[inventory_hostname] | to_nice_json }}"
dest: "{{ logs_dir }}/facts.json"
# NOTE(yoctozepto): this might not have been run during the
# regular run due to some earlier failure, yet logs content may
# still provide insight into that other, breaking issue
- name: Run check-logs.sh script
script: check-logs.sh
failed_when: false
when: not zuul_success | bool
- name: Run diagnostics script
environment:
KOLLA_INTERNAL_VIP_ADDRESS: "{{ kolla_internal_vip_address }}"
script: get_logs.sh
register: get_logs_result
become: true
failed_when: false
- name: Print get_logs output
debug:
msg: "{{ get_logs_result.stdout }}"
- name: Download /etc/hosts file to executor
synchronize:
src: "/etc/hosts"
dest: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}/"
mode: pull
ignore_errors: yes
- name: dump all iptables rules
shell: "iptables-save > /tmp/logs/iptables"
args:
creates: /tmp/logs/iptables
become: true
- name: Download /tmp/logs file to executor
synchronize:
src: "/tmp/logs"
dest: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}/"
mode: pull
rsync_opts:
- "--quiet"
- hosts: primary
environment:
PATH: "{{ ansible_env.HOME + '/.local/bin:' + ansible_env.PATH }}"
tasks:
- name: check for existence of ara sqlite
stat:
path: "{{ ansible_env.HOME }}/.ara/ansible.sqlite"
register: ara_stat_result
- block:
- name: ensure ara-report folder existence
file:
path: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}/ara-report"
state: directory
delegate_to: localhost
run_once: true
- name: download ara sqlite
synchronize:
src: "{{ ansible_env.HOME }}/.ara/ansible.sqlite"
dest: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}/ara-report/"
mode: pull
- name: Generate HTML from ARA database
command: "ara generate html {{ ansible_env.HOME }}/ara-html"
environment:
ARA_DATABASE: "sqlite:///{{ ansible_env.HOME }}/.ara/ansible.sqlite"
- name: Download ARA HTML
synchronize:
src: "{{ ansible_env.HOME }}/ara-html"
dest: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}/ara-report/"
mode: pull
rsync_opts:
- "--quiet"
when: ara_stat_result.stat.exists