9c1951478f
The tag regex is buggy and fails if the docker registry contains a port number[1]. [1] https://github.com/docker/docker-py/issues/3195 Change-Id: I5d85e751b490ab1e39e417ff8797ca8f8688590b Closes-Bug: #2054715
89 lines
3.0 KiB
YAML
89 lines
3.0 KiB
YAML
---
|
|
- name: Include OS family-specific variables
|
|
include_vars: "{{ ansible_facts.os_family }}.yml"
|
|
|
|
- name: Ensure EPEL repo is installed
|
|
package:
|
|
name: epel-release
|
|
state: present
|
|
become: True
|
|
when:
|
|
- ansible_facts.os_family == 'RedHat'
|
|
- kolla_install_epel | bool
|
|
|
|
- name: Ensure required packages are installed
|
|
package:
|
|
name: "{{ kolla_package_dependencies }}"
|
|
state: present
|
|
cache_valid_time: "{{ apt_cache_valid_time if ansible_facts.os_family == 'Debian' else omit }}"
|
|
update_cache: "{{ True if ansible_facts.os_family == 'Debian' else omit }}"
|
|
become: True
|
|
|
|
- name: Ensure source code checkout path exists
|
|
file:
|
|
path: "{{ kolla_source_path | dirname }}"
|
|
state: directory
|
|
owner: "{{ ansible_facts.user_uid }}"
|
|
group: "{{ ansible_facts.user_gid }}"
|
|
become: True
|
|
when: kolla_ctl_install_type == 'source'
|
|
|
|
- name: Ensure Kolla source code checkout exists
|
|
git:
|
|
repo: "{{ kolla_source_url }}"
|
|
dest: "{{ kolla_source_path }}"
|
|
version: "{{ kolla_source_version }}"
|
|
when: kolla_ctl_install_type == 'source'
|
|
|
|
- name: Ensure virtualenv parent directory exists
|
|
file:
|
|
path: "{{ kolla_venv | dirname }}"
|
|
state: directory
|
|
owner: "{{ ansible_facts.user_uid }}"
|
|
group: "{{ ansible_facts.user_gid }}"
|
|
become: True
|
|
when: kolla_venv is not none
|
|
|
|
- name: Ensure the latest version of pip is installed
|
|
pip:
|
|
name: "{{ item.name }}"
|
|
state: latest
|
|
virtualenv: "{{ kolla_venv }}"
|
|
virtualenv_command: "python3.{{ ansible_facts.python.version.minor }} -m venv"
|
|
with_items:
|
|
- { name: pip }
|
|
|
|
- name: Ensure Python package docker-py is absent
|
|
# In version 2.0.0, docker renamed the docker-py python package to docker.
|
|
# Kolla requires the docker package rather than the docker-py package.
|
|
pip:
|
|
name: docker-py
|
|
state: absent
|
|
virtualenv: "{{ kolla_venv }}"
|
|
|
|
- name: Ensure required Python packages are installed
|
|
pip:
|
|
name: "{{ item.name }}"
|
|
version: "{{ item.version | default(omit) }}"
|
|
state: "{{ item.state | default('present') }}"
|
|
virtualenv: "{{ kolla_venv }}"
|
|
extra_args: "{{ item.extra_args | default(default_extra_args) }}"
|
|
vars:
|
|
default_extra_args: "{% if kolla_upper_constraints_file %}-c {{ kolla_upper_constraints_file }}{% endif %}"
|
|
with_items:
|
|
# Install Kolla from source.
|
|
- name: "{{ kolla_source_path }}"
|
|
install: "{{ kolla_ctl_install_type == 'source' }}"
|
|
# Install Kolla from PyPI.
|
|
- name: "kolla"
|
|
version: "{{ kolla_openstack_release }}"
|
|
install: "{{ kolla_ctl_install_type == 'binary' }}"
|
|
# Install docker from PyPI since it was dropped from kolla requirements.
|
|
# Skip 7.0.0 due to: https://github.com/docker/docker-py/issues/3195
|
|
- name: "docker!=7.0.0,<8"
|
|
# NOTE(wszumski): Workaround for ERROR: ResolutionImpossible when using upper constraints.
|
|
# This can be removed once a newer version of docker is released and the version in upper
|
|
# constraints has been bumped (>7.0.0).
|
|
extra_args: "{{ omit }}"
|
|
when: item.install | default(True) | bool
|