diff --git a/ansible_tools/playbooks/cleanup-venvs.yml b/ansible_tools/playbooks/cleanup-venvs.yml index 862ec7c1..d0ed67b7 100644 --- a/ansible_tools/playbooks/cleanup-venvs.yml +++ b/ansible_tools/playbooks/cleanup-venvs.yml @@ -20,7 +20,7 @@ find: paths: /openstack/venvs file_type: directory - patterns: '.*(?<!{{ venv_tag }})$' + patterns: '^.*-(\d+(\.\d+){2})(?<!{{ venv_tag }})(-python[23])?$' use_regex: yes register: result - name: Delete older directories