From a12d2fce2bff9739d632a83011d8ed967c0e0a3c Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 3 Mar 2021 14:06:14 +1100 Subject: [PATCH] install-ansible: ensure stevedore We have identified an issue with stevedore < 3.3.0 where the cloud-launcher, running under ansible, makes stevedore hashe a /tmp path into a entry-point cache file it makes, causing a never-ending expansion. This appears to be fixed by [1] which is available in 3.3.0. Ensure we install this on bridge. For good measure, add a ".disable" file as we don't really need caches here. There's currently 491,089 leaked files, so I didn't think it wise to delete these in a ansible loop as it will probably time out the job. We can do this manually once we stop creating them :) [1] https://opendev.org/openstack/stevedore/commit/d7cfadbb7d2ffff65b0c25411369a978f91eee25 Change-Id: If5773613f953f64941a1d8cc779e893e0b2dd516 --- playbooks/roles/base/server/tasks/main.yaml | 6 ++++++ .../roles/install-ansible/tasks/main.yaml | 20 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/playbooks/roles/base/server/tasks/main.yaml b/playbooks/roles/base/server/tasks/main.yaml index de491342cc..2f515ea92b 100644 --- a/playbooks/roles/base/server/tasks/main.yaml +++ b/playbooks/roles/base/server/tasks/main.yaml @@ -58,6 +58,12 @@ src: bash-history.sh dest: /etc/profile.d/bash-history.sh +- name: Ensure root cache directory + file: + path: /root/.cache + state: directory + mode: 0700 + - name: Include OS-specific tasks include_tasks: "{{ lookup('first_found', file_list) }}" vars: diff --git a/playbooks/roles/install-ansible/tasks/main.yaml b/playbooks/roles/install-ansible/tasks/main.yaml index 65b9d03e93..46066afb70 100644 --- a/playbooks/roles/install-ansible/tasks/main.yaml +++ b/playbooks/roles/install-ansible/tasks/main.yaml @@ -140,6 +140,26 @@ version: '{{ _install_ansible_openstacksdk_version | default(omit) }}' state: '{{ _install_openstacksdk_state | default(omit) }}' +# NOTE(ianw) 2021-03-03 stevedore < 3.3.0 has a bug where it creates a +# constantly expanding set of cache files in +# /root/.cache/python-endpoints when run under ansible in a /tmp +# directory (this happens via cloud-launcher and openstacksdk). +# Ensure the production host is updated, and drop a .disable file +# for good measure +- name: Ensure stevedore >= 3.3.0 + pip: + name: 'stevedore>=3.3.0' +- name: Add stevedore cache dir + file: + path: /root/.cache/python-entrypoints/ + state: directory + mode: 0700 +- name: Add stevedore cache disable file + file: + path: /root/.cache/python-entrypoints/.disable + state: touch + mode: 0600 + - name: Ensure /etc/ansible and /etc/ansible/hosts file: state: directory