---
- name: install virtualenv requirments for pip
  become: yes
  package:
      name:
        - gcc
        - python-devel
        - python-setuptools
        - libffi-devel
      state: present

- name: install pip
  become: yes
  easy_install:
      name: pip

- name: install virtualenv pip module
  become: yes
  pip:
      name: virtualenv
      version: 15.0.3

# required to avoid any conflicts in venv with
# different packages versions (especially shade)
- name: cleanup shade venv if present
  file:
      state: absent
      path: "{{ shade_path_venv }}"

# installing setuptools and pip must happen before other packages and separated
# do not use shimming for these two special packages
- name: shade virtualenv core deps
  pip:
      name: "{{ item }}"
      virtualenv: "{{ shade_path_venv }}"
  with_items:
    - setuptools==17.0
    - pip==9.0.1

- name: shade virtualenv deps
  pip:
      name:
        - pytz==2016.4
        - shade==1.25.0
        - keystoneauth1<3.2.0
      # see https://projects.engineering.redhat.com/browse/RHOSINFRA-1562
      # TODO: unpin shade to avoid other conflicts
      virtualenv: "{{ shade_path_venv }}"

---
- name: install virtualenv requirments for pip
  become: yes
  package:
      name:
        - gcc
        - python-devel
        - python-setuptools
        - libffi-devel
      state: present

- name: install pip
  become: yes
  easy_install:
      name: pip

- name: install virtualenv pip module
  become: yes
  pip:
      name: virtualenv
      version: 15.0.3

# required to avoid any conflicts in venv with
# different packages versions (especially shade)
- name: cleanup shade venv if present
  file:
      state: absent
      path: "{{ shade_path_venv }}"

# installing setuptools and pip must happen before other packages and separated
# do not use shimming for these two special packages
- name: shade virtualenv core deps
  pip:
      name: "{{ item }}"
      virtualenv: "{{ shade_path_venv }}"
  with_items:
    - setuptools==17.0
    - pip==9.0.1

- name: shade virtualenv deps
  pip:
      name:
        - pytz==2016.4
        - cmd2==0.8.6
        - shade==1.25.0
        - keystoneauth1<3.2.0
      # see https://projects.engineering.redhat.com/browse/RHOSINFRA-1562
      # TODO: unpin shade to avoid other conflicts
      virtualenv: "{{ shade_path_venv }}"

Fix issue with unmet dependencies in shade role
Fix issue with unmet dependencies in shade role

Currently infrared master is broken because cmd2 util has been updated to
version 0.9.x and there was added verification:
'cmd2 requires Python '>=3.4' but the running Python is 2.7.5'

It's caused undercloud deployment is failed. As temp solution cmd2 version is
pinned to 0.8x

Change-Id: I32b7f0ddc86814294db0f0eda5cf300ad320de66
