blob: 8379e6b41ed25381eb9fc32dfb8e397fbff822f0 [file] [log] [blame]
Fatih Degirmenci50b146b2019-05-10 14:11:57 +02001---
2# ============LICENSE_START=======================================================
3# Copyright (C) 2019 The Nordix Foundation. All rights reserved.
4# ================================================================================
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16#
17# SPDX-License-Identifier: Apache-2.0
18# ============LICENSE_END=========================================================
Fatih Degirmencief0b16f2020-01-08 23:53:05 +000019
Fatih Degirmenci50b146b2019-05-10 14:11:57 +020020- include_tasks: cleanup-bifrost.yml
21
22- name: Clone bifrost repository and checkout '{{ bifrost_version }}'
23 git:
24 repo: "{{ bifrost_git_url }}"
25 dest: "{{ engine_cache }}/repos/bifrost"
26 version: "{{ bifrost_version }}"
27 force: yes
28 environment:
29 http_proxy: "{{ lookup('env','http_proxy') }}"
30 https_proxy: "{{ lookup('env','https_proxy') }}"
31 no_proxy: "{{ lookup('env','no_proxy') }}"
32
33- name: Install bifrost requirements
34 pip:
35 requirements: "{{ engine_cache }}/repos/bifrost/requirements.txt"
36 extra_args: --upgrade
37
38- name: Process PDF and IDF
39 set_fact:
40 num_nodes: "{{ nodes | length }}"
41 hosts: "{{ idf[installer_type].hostnames }}"
42 host_roles: "{{ idf[installer_type].nodes_roles }}"
43 networks: "{{ idf[installer_type].network }}"
44 bifrost_inventory: {}
45
46- name: Create DHCP hosts directory
47 file:
48 path: "/etc/dnsmasq.d/bifrost.dhcp-hosts.d"
49 state: directory
50 owner: "root"
51 group: "root"
52 mode: 0755
53 become: yes
54
55- include_tasks: create-bifrost-inventory-entry.yml
56 with_dict: "{{ hosts }}"
57 loop_control:
58 loop_var: host
59
60- include_tasks: create-bifrost-inventory-file.yml
61
62- include_tasks: create-bifrost-playbooks.yml
63
64- name: Create folders to put ipa and deployment images
65 file:
66 path: "{{ item }}"
67 state: directory
68 owner: root
69 group: root
70 mode: 0755
71 with_items:
72 - /httpboot
73 - /tftpboot
74 become: yes
75
76# we want users to use prebuilt ipa images but not deployment images
77# as the deployment images contain ssh public key of the user so we
78# download ipa images by default and not the deployment image
79- include_tasks: download-image.yml
80 with_items:
81 - { source: "{{ deployment_image }}", destination: "/httpboot/deployment_image.qcow2", download: "{{ use_prebuilt_deployment_image }}" }
82 - { source: "{{ ipa_initramfs }}", destination: "/httpboot/ipa.initramfs", download: "true" }
Fatih Degirmenci766f23c2019-12-04 11:21:02 +010083 - { source: "{{ ipa_kernel }}", destination: "/httpboot/ipa.kernel", download: "true" }
Fatih Degirmenci50b146b2019-05-10 14:11:57 +020084
85# vim: set ts=2 sw=2 expandtab: