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

126 lines
3.7 KiB
YAML

# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# 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.
---
- name: "Update Package Cache"
apt: update_cache=yes
when: ansible_os_family == 'Debian'
- name: "Install packages"
package:
name: "{{ required_packages }}"
state: present
# 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
- name: "Install vendor dependencies"
import_tasks: vendor_deps.yml
- name: "Install iSCSI client and dependencies if iscsi deploy interface is enabled"
package:
name: "{{ iscsi_required_packages }}"
state: present
when: not (skip_install | bool) and 'iscsi' in enabled_deploy_interfaces
- name: "IPA-builder - Install"
include_role:
name: bifrost-pip-install
vars:
package: ironic-python-agent-builder
sourcedir: "{{ ipa_builder_git_folder }}"
source_install: true
when: install_dib | bool
# NOTE(mgoddard): IPA-builder has a dependency on diskimage-builder. Install
# DIB last to ensure it is installed from source rather than PyPI.
- name: "Diskimage-builder - Install"
include_role:
name: bifrost-pip-install
vars:
package: diskimage-builder
sourcedir: "{{ dib_git_folder }}"
source_install: true
when: install_dib | bool
- name: "sushy - Install"
include_role:
name: bifrost-pip-install
vars:
package: sushy
sourcedir: "{{ sushy_git_folder }}"
source_install: "{{ sushy_source_install }}"
- name: "Ironic Client - Install"
include_role:
name: bifrost-pip-install
vars:
package: python-ironicclient
sourcedir: "{{ ironicclient_git_folder }}"
source_install: "{{ ironicclient_source_install }}"
# NOTE(dtantsur): no much value in installing metalsmith from source - it does
# not change often, and nothing in bifrost depends on it.
- name: "metalsmith - Install"
include_role:
name: bifrost-pip-install
vars:
package: metalsmith
source_install: false
- name: "Install pymysql"
include_role:
name: bifrost-pip-install
vars:
package: pymysql
- name: "Install extra packages for ironic"
include_role:
name: bifrost-pip-install
vars:
package: "{{ item }}"
loop: "{{ ironic_extra_packages }}"
- name: "Install Ironic using pip"
include_role:
name: bifrost-pip-install
vars:
package: ironic
sourcedir: "{{ ironic_git_folder }}"
source_install: true
extra_args: "--no-cache-dir {{ pip_opts }}"
- name: "Install ironic-inspector to permit use of inspection interface"
include_tasks: inspector_install.yml
when: enable_inspector | bool
- name: "Install ironic-staging-drivers"
include_tasks: staging_install.yml
when: staging_drivers_include | bool
- name: "Install openstacksdk"
include_role:
name: bifrost-pip-install
vars:
package: openstacksdk
sourcedir: "{{ openstacksdk_git_folder }}"
source_install: "{{ openstacksdk_source_install }}"
- name: "Install Ironic Prometheus Exporter"
include_tasks: prometheus_exporter_install.yml
when: enable_prometheus_exporter | bool