forked from cyverse-archive/de-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
/
verify-python-pip.yaml
27 lines (22 loc) · 994 Bytes
/
verify-python-pip.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
---
- name: Verify python and pip are installed
hosts: docker-ready
tasks:
- name: Verify python is installed
shell: yum list installed python
register: verify_python_installed_centos
when: ansible_distribution == "CentOS" and
ansible_distribution_major_version == "7"
- name: Verify pip is installed
shell: pip --version
register: verify_python_pip_installed_centos
when: ansible_distribution == "CentOS" and
ansible_distribution_major_version == "7"
- fail: msg="Python must be installed"
when: ansible_distribution == "CentOS" and
ansible_distribution_major_version == "7" and
verify_python_installed_centos.rc != 0
- fail: msg="Python-pip must be installed"
when: ansible_distribution == "CentOS" and
ansible_distribution_major_version == "7" and
verify_python_pip_installed_centos.rc != 0