bifrost/playbooks/roles/bifrost-keystone-install/tasks/install.yml

104 lines
3.5 KiB
YAML

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
- include: roles/common/venv_python_path.yml
- name: "Install packages"
action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
with_items: "{{ required_packages }}"
environment: "{{ venv }}"
# NOTE(TheJulia) While we don't necessarilly require /opt/stack any longer
# and it should already be created by the Ansible setup, we will leave this
# here for the time being.
- name: "Ensure /opt/stack is present"
file: name=/opt/stack state=directory owner=root group=root
when: skip_install is not defined
# NOTE(TheJulia): Part of Bifrost's install does this as well, but
# duplicating here as we are installing a separate service with this.
# We may wish to refactor this at a later point in time.
- name: "Install configparser in venv if using"
include: pip_install.yml
package=configparser
virtualenv=bifrost_venv_dir
extra_args="-c {{ upper_constraints_file }}"
when:
- skip_install is not defined
- enable_venv | bool == true
- name: "Install pymysql in venv if using"
include: pip_install.yml
package=pymysql
virtualenv=bifrost_venv_dir
extra_args="-c {{ upper_constraints_file }}"
when:
- skip_install is not defined
- enable_venv | bool == true
- name: "Install python-openstackclient in venv if using"
include: pip_install.yml
package=python-openstackclient
virtualenv=bifrost_venv_dir
extra_args="-c {{ upper_constraints_file }}"
when:
- skip_install is not defined
- enable_venv | bool == true
- name: "Install keystone in venv if using"
include: pip_install.yml
package=keystone
virtualenv=bifrost_venv_dir
state=latest
sourcedir={{ keystone_git_folder }}
source_install={{ keystone_source_install | bool }}
extra_args="--no-cache-dir --upgrade --upgrade-strategy only-if-needed -c {{ upper_constraints_file }}"
when:
- skip_install is not defined
- enable_venv | bool == true
- name: "Install configparser if not using a venv"
include: pip_install.yml
package=configparser
extra_args="-c {{ upper_constraints_file }}"
when:
- skip_install is not defined
- enable_venv | bool == false
- name: "Install pymysql if not using a venv"
include: pip_install.yml
package=pymysql
extra_args="-c {{ upper_constraints_file }}"
when:
- skip_install is not defined
- enable_venv | bool == false
- name: "Install python-openstackclient if not using a venv"
include: pip_install.yml
package=python-openstackclient
extra_args="-c {{ upper_constraints_file }}"
when:
- skip_install is not defined
- enable_venv | bool == false
- name: "Install keystone if not using a venv"
include: pip_install.yml
package=keystone
state=latest
sourcedir={{ keystone_git_folder }}
source_install={{ keystone_source_install | bool }}
extra_args="--no-cache-dir --upgrade --upgrade-strategy only-if-needed -c {{ upper_constraints_file }}"
when:
- skip_install is not defined
- enable_venv | bool == false