blob: 1befc883704882baa5b3ddbdbdd39e1f96ff4559 [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=========================================================
19- include_tasks: cleanup-bifrost.yml
20
21- name: Clone bifrost repository and checkout '{{ bifrost_version }}'
22 git:
23 repo: "{{ bifrost_git_url }}"
24 dest: "{{ engine_cache }}/repos/bifrost"
25 version: "{{ bifrost_version }}"
26 force: yes
27 environment:
28 http_proxy: "{{ lookup('env','http_proxy') }}"
29 https_proxy: "{{ lookup('env','https_proxy') }}"
30 no_proxy: "{{ lookup('env','no_proxy') }}"
31
32- name: Install bifrost requirements
33 pip:
34 requirements: "{{ engine_cache }}/repos/bifrost/requirements.txt"
35 extra_args: --upgrade
36
37- name: Process PDF and IDF
38 set_fact:
39 num_nodes: "{{ nodes | length }}"
40 hosts: "{{ idf[installer_type].hostnames }}"
41 host_roles: "{{ idf[installer_type].nodes_roles }}"
42 networks: "{{ idf[installer_type].network }}"
43 bifrost_inventory: {}
44
45- name: Create DHCP hosts directory
46 file:
47 path: "/etc/dnsmasq.d/bifrost.dhcp-hosts.d"
48 state: directory
49 owner: "root"
50 group: "root"
51 mode: 0755
52 become: yes
53
54- include_tasks: create-bifrost-inventory-entry.yml
55 with_dict: "{{ hosts }}"
56 loop_control:
57 loop_var: host
58
59- include_tasks: create-bifrost-inventory-file.yml
60
61- include_tasks: create-bifrost-playbooks.yml
62
63- name: Create folders to put ipa and deployment images
64 file:
65 path: "{{ item }}"
66 state: directory
67 owner: root
68 group: root
69 mode: 0755
70 with_items:
71 - /httpboot
72 - /tftpboot
73 become: yes
74
75# we want users to use prebuilt ipa images but not deployment images
76# as the deployment images contain ssh public key of the user so we
77# download ipa images by default and not the deployment image
78- include_tasks: download-image.yml
79 with_items:
80 - { source: "{{ deployment_image }}", destination: "/httpboot/deployment_image.qcow2", download: "{{ use_prebuilt_deployment_image }}" }
81 - { source: "{{ ipa_initramfs }}", destination: "/httpboot/ipa.initramfs", download: "true" }
Fatih Degirmenci766f23c2019-12-04 11:21:02 +010082 - { source: "{{ ipa_kernel }}", destination: "/httpboot/ipa.kernel", download: "true" }
Fatih Degirmenci50b146b2019-05-10 14:11:57 +020083
84# vim: set ts=2 sw=2 expandtab: