ansible-role-refstack-client/tasks/install-packages.yaml
Martin Kopec b2bd953ec2 Comply with ansible lint
Adds openstack-tox-linters job and edits the source code
so that it complies with the ansible and yaml lint.
Also creates requirements files, setup.* files and tox.ini
one according the other ansible-role-* projects.

Change-Id: If538c081a9f0f462714381baab002de5b403fde0
2020-10-15 13:58:05 +00:00

50 lines
1.0 KiB
YAML

---
- name: Is python available
command: "python --version"
ignore_errors: true
register: python_is_available
changed_when: false
- name: Install git
become: true
package:
name: git
- name: Install virtualenv
become: true
package:
name: python-virtualenv
when: python_is_available.rc == 0
- name: Install virtualenv
become: true
package:
name: python3-virtualenv
when: python_is_available.rc != 0
- name: Check if pip is already installed
command: "pip --version"
ignore_errors: true
register: pip_is_installed
changed_when: false
- name: Check if pip3 is already installed
command: "pip3 --version"
ignore_errors: true
register: pip3_is_installed
changed_when: false
- when:
- pip_is_installed.rc != 0
- pip3_is_installed.rc != 0
block:
- name: download get-pip.py
get_url: url=https://bootstrap.pypa.io/get-pip.py dest=/tmp
- name: install pip
become: true
command: "python /tmp/get-pip.py"
- name: delete get-pip.py
file: state=absent path=/tmp/get-pip.py