From 632a5367b19e7410c55b98fa1f8c8362dc870fcf Mon Sep 17 00:00:00 2001 From: Olivier Bourdon Date: Wed, 3 Oct 2018 09:20:11 +0200 Subject: [PATCH] Fix CI for CentOS Change-Id: I7d8c2b29ece07ead5f6e23706a5e51d4c1b65ad8 --- .../roles/bifrost-create-vm-nodes/tasks/prepare_libvirt.yml | 6 ++++++ playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml | 2 +- .../bifrost-ironic-install/tasks/inspector_bootstrap.yml | 2 +- .../roles/bifrost-keystone-install/tasks/bootstrap.yml | 2 +- scripts/collect-test-info.sh | 6 ++++++ scripts/install-deps.sh | 5 +++++ 6 files changed, 20 insertions(+), 3 deletions(-) diff --git a/playbooks/roles/bifrost-create-vm-nodes/tasks/prepare_libvirt.yml b/playbooks/roles/bifrost-create-vm-nodes/tasks/prepare_libvirt.yml index b4b925443..bfbb54763 100644 --- a/playbooks/roles/bifrost-create-vm-nodes/tasks/prepare_libvirt.yml +++ b/playbooks/roles/bifrost-create-vm-nodes/tasks/prepare_libvirt.yml @@ -139,6 +139,12 @@ recurse: yes mode: "0755" +- name: ensure parent dir for bm logs has proper rights + file: + state: directory + path: "{{ test_vm_logdir | dirname }}" + mode: "0755" + - name: install virtualbmc pip: name: virtualbmc diff --git a/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml b/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml index 3039acfba..cde9070fa 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/bootstrap.yml @@ -104,7 +104,7 @@ - name: Setting MySQL socket fact set_fact: - mysql_socket_path: "/var/run/{% if ansible_distribution | lower is search('suse') %}mysql/mysql.sock{% else %}mysqld/mysqld.sock{% endif %}" + mysql_socket_path: "/var/{% if ansible_os_family | lower == 'redhat' %}lib{% else %}run{% endif %}/{% if ansible_os_family | lower == 'debian' %}mysqld/mysqld.sock{% else %}mysql/mysql.sock{% endif %}" when: ansible_version.full is version_compare('2.6.5', '>=') - name: "MySQL - Creating DB" diff --git a/playbooks/roles/bifrost-ironic-install/tasks/inspector_bootstrap.yml b/playbooks/roles/bifrost-ironic-install/tasks/inspector_bootstrap.yml index a625764f7..75a1802e1 100644 --- a/playbooks/roles/bifrost-ironic-install/tasks/inspector_bootstrap.yml +++ b/playbooks/roles/bifrost-ironic-install/tasks/inspector_bootstrap.yml @@ -15,7 +15,7 @@ --- - name: Setting MySQL socket fact set_fact: - mysql_socket_path: "/var/run/{% if ansible_distribution | lower is search('suse') %}mysql/mysql.sock{% else %}mysqld/mysqld.sock{% endif %}" + mysql_socket_path: "/var/{% if ansible_os_family | lower == 'redhat' %}lib{% else %}run{% endif %}/{% if ansible_os_family | lower == 'debian' %}mysqld/mysqld.sock{% else %}mysql/mysql.sock{% endif %}" when: ansible_version.full is version_compare('2.6.5', '>=') - name: "MySQL - Create database" diff --git a/playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml b/playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml index de02a674c..c45026220 100644 --- a/playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml +++ b/playbooks/roles/bifrost-keystone-install/tasks/bootstrap.yml @@ -73,7 +73,7 @@ - name: Setting MySQL socket fact set_fact: - mysql_socket_path: "/var/run/{% if ansible_distribution | lower is search('suse') %}mysql/mysql.sock{% else %}mysqld/mysqld.sock{% endif %}" + mysql_socket_path: "/var/{% if ansible_os_family | lower == 'redhat' %}lib{% else %}run{% endif %}/{% if ansible_os_family | lower == 'debian' %}mysqld/mysqld.sock{% else %}mysql/mysql.sock{% endif %}" when: ansible_version.full is version_compare('2.6.5', '>=') - name: "MySQL - Creating DB" diff --git a/scripts/collect-test-info.sh b/scripts/collect-test-info.sh index d2af7edb4..b522c7272 100755 --- a/scripts/collect-test-info.sh +++ b/scripts/collect-test-info.sh @@ -37,10 +37,12 @@ if $(journalctl --version &>/dev/null); then sudo journalctl -u ironic-api &> ${LOG_LOCATION}/ironic-api.log sudo journalctl -u ironic-conductor &> ${LOG_LOCATION}/ironic-conductor.log sudo journalctl -u ironic-inspector &> ${LOG_LOCATION}/ironic-inspector.log + sudo journalctl -u libvirtd &> ${LOG_LOCATION}/libvirtd.log else sudo cp /var/log/upstart/ironic-api.log ${LOG_LOCATION}/ sudo cp /var/log/upstart/ironic-conductor.log ${LOG_LOCATION}/ sudo cp /var/log/upstart/ironic-inspector.log ${LOG_LOCATION}/ + sudo cp /var/log/upstart/libvirtd.log ${LOG_LOCATION}/ fi # Copy PXE information @@ -58,6 +60,10 @@ if [ -d "/var/log/ironic" ]; then cp -a "/var/log/ironic" ${LOG_LOCATION}/ipa-logs fi +sudo vbmc list &> ${LOG_LOCATION}/vbmc.txt +sudo virsh list --all &> ${LOG_LOCATION}/virsh-list.txt +ps auxf &> ${LOG_LOCATION}/ps.txt + sudo chown -R $USER ${LOG_LOCATION} # In CI scenarios, we want other users to be able to read the logs. sudo chmod -R o+r ${LOG_LOCATION} diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index 8e13d9d97..b8e7f6555 100644 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -184,6 +184,11 @@ sudo -H -E ${PIP} install "pip>6.0" # upgrade setuptools, as latest version is needed to install some projects sudo -H -E ${PIP} install --upgrade --force setuptools +if [ "$OS_FAMILY" == "RedHat" ]; then + sudo -H -E ${PIP} freeze + sudo -H -E ${PIP} install --ignore-installed pyparsing ipaddress +fi + sudo -H -E ${PIP} install -r "$(dirname $0)/../requirements.txt" # Install the rest of required packages using bindep