Comment 3 for bug 1693409

Revision history for this message
Andrew Price (andrpric) wrote :

I had the same problem targeting Ice House, Juno, and Mitaka clouds when trying to utilize virtualenv.

I was however able to address the issue. Below are some relevant ansible playbook configs:

- name: Download OSPurge git repo
  git:
    repo: 'https://github.com/openstack/ospurge.git'
    dest: '{{ git_repo_folder }}/ospurge'

- name: Install Packages for Python3
  yum:
    name: '{{ item }}'
    state: present
  with_items:
    - python34
    - python34-devel
    - python34-pip

- name: Install packages via pip3
  pip:
    name: '{{ item }}'
    state: present
    executable: pip3.4
  with_items:
    - os-client-config
    - pbr
    - shade
    - typing

- name: Check if OSPurge is installed
  shell: 'which ospurge'
  register: ospurge_installed
  ignore_errors: true
  changed_when: false

- name: Install OSPurge
  shell: 'python3.4 setup.py install'
  args:
    chdir: '{{ git_repo_folder }}/ospurge/'
  when: ospurge_installed.rc != 0

- name: Copy OSPurge bash script
  template:
    src: 'ospurge.sh.j2'
    dest: '{{ scripts_folder }}/ospurge.sh'
    mode: '0700'

### ospurge.sh.j2 ###
#!/bin/bash
set -e
source /root/openrc
cd {{ git_repo_folder }}/ospurge
ospurge --verbose --purge-own-project