Files
kayobe/ansible/roles/kolla/tasks/install.yml
Mark Goddard c4ffd39478 Switch to generic package module
This makes platform independence easier. There are some cases where we
still use the yum module, where we use yum-specific module parameters.

Also switch use of the state 'installed' to 'present', which is
supported by all the package modules, whereas installed is supported by
the yum module only.

Change-Id: Id1cf845adc7aa6565a7a570569c9a81a478560f0
2019-12-09 10:21:20 +00:00

80 lines
2.2 KiB
YAML

---
- name: Ensure EPEL repo is installed
package:
name: epel-release
state: present
become: True
when:
- ansible_os_family == 'RedHat'
- kolla_install_epel | bool
- name: Ensure required packages are installed
package:
name:
- gcc
- libffi-devel
- openssl-devel
- python-devel
- python-pip
- python-virtualenv
state: present
become: True
- name: Ensure source code checkout path exists
file:
path: "{{ kolla_source_path | dirname }}"
state: directory
owner: "{{ ansible_user_uid }}"
group: "{{ ansible_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_user_uid }}"
group: "{{ ansible_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 }}"
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