blob: 8379e6b41ed25381eb9fc32dfb8e397fbff822f0 [file] [log] [blame]
---
# ============LICENSE_START=======================================================
# Copyright (C) 2019 The Nordix Foundation. All rights reserved.
# ================================================================================
# 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.
#
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
- include_tasks: cleanup-bifrost.yml
- name: Clone bifrost repository and checkout '{{ bifrost_version }}'
git:
repo: "{{ bifrost_git_url }}"
dest: "{{ engine_cache }}/repos/bifrost"
version: "{{ bifrost_version }}"
force: yes
environment:
http_proxy: "{{ lookup('env','http_proxy') }}"
https_proxy: "{{ lookup('env','https_proxy') }}"
no_proxy: "{{ lookup('env','no_proxy') }}"
- name: Install bifrost requirements
pip:
requirements: "{{ engine_cache }}/repos/bifrost/requirements.txt"
extra_args: --upgrade
- name: Process PDF and IDF
set_fact:
num_nodes: "{{ nodes | length }}"
hosts: "{{ idf[installer_type].hostnames }}"
host_roles: "{{ idf[installer_type].nodes_roles }}"
networks: "{{ idf[installer_type].network }}"
bifrost_inventory: {}
- name: Create DHCP hosts directory
file:
path: "/etc/dnsmasq.d/bifrost.dhcp-hosts.d"
state: directory
owner: "root"
group: "root"
mode: 0755
become: yes
- include_tasks: create-bifrost-inventory-entry.yml
with_dict: "{{ hosts }}"
loop_control:
loop_var: host
- include_tasks: create-bifrost-inventory-file.yml
- include_tasks: create-bifrost-playbooks.yml
- name: Create folders to put ipa and deployment images
file:
path: "{{ item }}"
state: directory
owner: root
group: root
mode: 0755
with_items:
- /httpboot
- /tftpboot
become: yes
# we want users to use prebuilt ipa images but not deployment images
# as the deployment images contain ssh public key of the user so we
# download ipa images by default and not the deployment image
- include_tasks: download-image.yml
with_items:
- { source: "{{ deployment_image }}", destination: "/httpboot/deployment_image.qcow2", download: "{{ use_prebuilt_deployment_image }}" }
- { source: "{{ ipa_initramfs }}", destination: "/httpboot/ipa.initramfs", download: "true" }
- { source: "{{ ipa_kernel }}", destination: "/httpboot/ipa.kernel", download: "true" }
# vim: set ts=2 sw=2 expandtab: