d8fe45b3d8
Having tagged plays allows us to easily run a subset of the plays for a command, and perform targeted operations with less risk of unintended consequences. The tags are typically named after the playbook, although some of the overcloud playbooks have been tagged without an overcloud- prefix.
31 lines
1.1 KiB
YAML
31 lines
1.1 KiB
YAML
---
|
|
- name: Ensure docker SDK for python is installed
|
|
hosts: overcloud
|
|
tags:
|
|
- docker-sdk-upgrade
|
|
tasks:
|
|
# Docker renamed their python SDK from docker-py to docker in the 2.0.0
|
|
# release, and also broke backwards compatibility. Kolla-ansible requires
|
|
# docker, so ensure it is installed.
|
|
- name: Set a fact about the virtualenv on the remote system
|
|
set_fact:
|
|
virtualenv: "{{ ansible_python_interpreter | dirname | dirname }}"
|
|
when:
|
|
- ansible_python_interpreter is defined
|
|
- not ansible_python_interpreter.startswith('/bin/')
|
|
- not ansible_python_interpreter.startswith('/usr/bin/')
|
|
|
|
- name: Ensure legacy docker-py python package is uninstalled
|
|
pip:
|
|
name: docker-py
|
|
state: absent
|
|
virtualenv: "{{ virtualenv is defined | ternary(virtualenv, omit) }}"
|
|
become: "{{ virtualenv is not defined }}"
|
|
|
|
- name: Ensure docker SDK for python is installed
|
|
pip:
|
|
name: docker
|
|
state: latest
|
|
virtualenv: "{{ virtualenv is defined | ternary(virtualenv, omit) }}"
|
|
become: "{{ virtualenv is not defined }}"
|