78 lines
2.1 KiB
YAML
78 lines
2.1 KiB
YAML
---
|
|
- name: Ensure EPEL repo is installed
|
|
yum:
|
|
name: epel-release
|
|
state: installed
|
|
become: True
|
|
|
|
- name: Ensure required packages are installed
|
|
yum:
|
|
name: "{{ item }}"
|
|
state: installed
|
|
become: True
|
|
with_items:
|
|
- gcc
|
|
- libffi-devel
|
|
- openssl-devel
|
|
- python-devel
|
|
- python-pip
|
|
- python-virtualenv
|
|
|
|
- name: Ensure source code checkout path exists
|
|
file:
|
|
path: "{{ kolla_source_path | dirname }}"
|
|
state: directory
|
|
owner: "{{ ansible_user_id }}"
|
|
group: "{{ ansible_user_id }}"
|
|
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_user_id }}"
|
|
group: "{{ ansible_user_id }}"
|
|
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 }}"
|
|
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: "{% if kolla_upper_constraints_file %}-c {{ kolla_upper_constraints_file }}{% endif %}"
|
|
with_items:
|
|
# Intall Kolla from source.
|
|
- name: "{{ kolla_source_path }}"
|
|
install: "{{ kolla_ctl_install_type == 'source' }}"
|
|
# Intall Kolla from PyPI.
|
|
- name: "kolla"
|
|
version: "{{ kolla_openstack_release }}"
|
|
install: "{{ kolla_ctl_install_type == 'binary' }}"
|
|
when: item.install | default(True) | bool
|