Files
kayobe/ansible/roles/kolla-ansible/tasks/install.yml
Mark Goddard 4acbf52867 Untangle configuration of kolla and kolla-ansible
Kolla (container images) and kolla-ansible (container deployment) are
separate concerns, and should be treated as such. Configuration
variables have been added for kolla-ansible which were previously shared
between the two projects:

kolla_venv -> kolla_ansible_venv
kolla_ctl_install_type -> kolla_ansible_ctl_install_type

Also, we introduce specific variables for the source code repository
checkout paths, which were previously both based on
source_checkout_path:

kolla_source_path
kolla_ansible_source_path

These changes help us to cleanly separate the configuration of paths on
the local (Ansible control) host, from those on the managed (target)
hosts. This is important because the local paths may be specific to the
environment in which the user is running kayobe, but the remote paths
are relatively fixed and specific to the cluster.
2017-09-18 14:21:52 +01:00

78 lines
2.5 KiB
YAML

---
- name: Include OS family-specific variables
include_vars: "{{ ansible_os_family }}.yml"
- name: Ensure EPEL repo is installed
yum:
name: epel-release
state: installed
become: True
when: ansible_os_family == 'RedHat'
- name: Ensure required packages are installed
package:
name: "{{ item }}"
state: installed
become: True
with_items: "{{ kolla_ansible_package_dependencies }}"
- name: Ensure source code checkout parent directory exists
file:
path: "{{ kolla_ansible_source_path | dirname }}"
state: directory
owner: "{{ ansible_user }}"
group: "{{ ansible_user }}"
become: True
when: "{{ kolla_ansible_ctl_install_type == 'source' }}"
- name: Ensure Kolla Ansible source code checkout exists
git:
repo: "{{ kolla_ansible_source_url }}"
dest: "{{ kolla_ansible_source_path }}"
version: "{{ kolla_ansible_source_version }}"
when: "{{ kolla_ansible_ctl_install_type == 'source' }}"
- name: Ensure the latest version of pip is installed
pip:
name: "{{ item.name }}"
state: latest
virtualenv: "{{ kolla_ansible_venv }}"
with_items:
- { name: pip }
- name: Ensure required Python packages are installed
pip:
name: "{{ item.name }}"
version: "{{ item.version | default(omit) }}"
state: present
virtualenv: "{{ kolla_ansible_venv }}"
with_items:
# Intall Kolla Ansible from source.
- name: "{{ kolla_ansible_source_path }}"
install: "{{ kolla_ansible_ctl_install_type == 'source' }}"
# Intall Kolla Ansible from PyPI.
- name: "kolla-ansible"
version: "{{ kolla_openstack_release }}"
install: "{{ kolla_ansible_ctl_install_type == 'binary' }}"
# On CentOS 7.3 Jinja2==2.7, but kolla-ansible requires 2.8. Install
# Ansible to ensure we pull in and use a later Jinja2.
- name: "ansible"
version: "2.2"
# Required for kolla-genpwd.
- name: PyYAML
version: "3.12"
when: "{{ item.install | default(True) | bool }}"
# This is a workaround for the lack of a python package for libselinux-python
# on PyPI. Without using --system-site-packages to create the virtualenv, it
# seems difficult to ensure the selinux python module is available. It is a
# dependency for Ansible when selinux is enabled.
- name: Ensure selinux Python package is linked into the virtualenv
file:
src: "/usr/lib64/python2.7/site-packages/selinux"
dest: "{{ kolla_ansible_venv }}/lib/python2.7/site-packages/selinux"
state: link
when:
- ansible_selinux != False
- ansible_selinux.status != 'disabled'