Create engine kubernetes stack
This change creates kubernetes stack for engine in order to package,
deploy, and test stacks independently from engine core.
The main feature this enables is the ability to develop stacks
in their own repository with proper versioning and branching no
matter how the tools (provisioner and installer) are developed.
The stack simply selects versions of the tools (could be branches)
and the rest is done accordingly.
The role package which was previously located under
infra/installer/kubespray is moved into this repository in order to
handle what to package within the stack since some of the artifacts
we package do not belong to installer but to the stack itself.
Change-Id: I760d4d904544dad768525e999ebe53e156464111
diff --git a/playbooks/roles/package/tasks/main.yaml b/playbooks/roles/package/tasks/main.yaml
new file mode 100644
index 0000000..a1296b1
--- /dev/null
+++ b/playbooks/roles/package/tasks/main.yaml
@@ -0,0 +1,87 @@
+---
+# ============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=========================================================
+
+- name: Prepare packaging
+ include_tasks: prepare-packaging.yaml
+
+- name: Create folder to store dependencies for offline deployment
+ file:
+ path: "{{ offline_pkg_folder }}"
+ state: "{{ item }}"
+ with_items:
+ - absent
+ - directory
+
+- name: Install packages on {{ ansible_os_family }}
+ include_tasks: "install-packages-{{ ansible_os_family }}.yml"
+
+# TODO (fdegir): we need to switch to build with dib here
+- name: Fetch operating system images for provisioning
+ include_tasks: dib.yaml
+
+# collect apt packages
+- name: Fetch operating system packages
+ include_tasks: "pkg-{{ ansible_os_family }}.yaml"
+
+# clone git repositories
+- name: Fetch git repositories
+ include_tasks: git.yaml
+
+# download binaries
+- name: Fetch binaries
+ include_tasks: binaries.yaml
+
+# download pip packages
+- name: Fetch pip python packages
+ include_tasks: pip.yaml
+
+# fetch k8s container images
+- name: Fetch container images
+ include_tasks: containers.yaml
+
+# ensure we don't have leftovers
+- name: Delete outdated files
+ file:
+ path: "{{ item }}"
+ state: absent
+ with_items:
+ - "{{ offline_pkg_file }}"
+ - "{{ offline_pkg_folder }}/install.sh"
+ - "{{ offline_installer_file }}"
+ - "/tmp/decompress.sh"
+
+- name: Copy decompress and install scripts
+ copy:
+ src: "{{ item.src }}"
+ dest: "{{ item.dest }}"
+ mode: 0755
+ with_items:
+ - {src: "install.sh", dest: "{{ offline_pkg_folder }}/install.sh"}
+ - {src: "decompress.sh", dest: "/tmp/decompress.sh"}
+
+# create tarball
+- name: Create engine installer file
+ script: build.sh
+ register: build_script
+
+- name: Log build script output to console
+ debug:
+ msg: "{{ build_script.stdout_lines }}"
+
+# vim: set ts=2 sw=2 expandtab: