Merge "Gate: Dont deploy pip dist package if already installed"

This commit is contained in:
Zuul 2018-05-13 17:56:53 +00:00 committed by Gerrit Code Review
commit 12965b1615

View File

@ -12,14 +12,20 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
- name: check if pip installed
command: pip --version
register: pip_version_output
ignore_errors: yes
changed_when: false
- name: ensuring python pip package is present for ubuntu - name: ensuring python pip package is present for ubuntu
when: ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' when: ( pip_version_output is failed ) and ( ansible_distribution == 'Debian' or ansible_distribution == 'Ubuntu' )
apt: apt:
name: python-pip name: python-pip
state: present state: present
- name: ensuring python pip package is present for centos - name: ensuring python pip package is present for centos
when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' when: ( pip_version_output is failed ) and ( ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux' )
block: block:
- name: ensuring epel-release package is present for centos as python-pip is in the epel repo - name: ensuring epel-release package is present for centos as python-pip is in the epel repo
yum: yum:
@ -30,8 +36,8 @@
name: python-devel name: python-devel
state: present state: present
- name: ensuring python pip package is present for fedora via the python-devel rpm - name: ensuring python pip package is present for fedora via the python2-pip rpm
when: ansible_distribution == 'Fedora' when: ( pip_version_output is failed ) and ( ansible_distribution == 'Fedora' )
dnf: dnf:
name: python2-pip name: python2-pip
state: present state: present