--- /dev/null
+#!/bin/bash
+# ============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=========================================================
+
+set -o errexit
+set -o nounset
+set -o pipefail
+
+#-------------------------------------------------------------------------------
+# Bootstrap stack software configuration
+#-------------------------------------------------------------------------------
+echo "Info : Bootstrap stack software configuration"
+echo "-------------------------------------------------------------------------"
+cd "${ENGINE_PATH}"
+ansible-playbook "${ENGINE_ANSIBLE_PARAMS[@]}" \
+ -i "${ENGINE_PATH}/engine/inventory/localhost.ini" \
+ engine/stack/kubernetes/playbooks/bootstrap-swconfig.yaml
+echo "-------------------------------------------------------------------------"
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+---
+# ============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=========================================================
+
+- hosts: localhost
+ connection: local
+ gather_facts: true
+ become: false
+
+ roles:
+ - role: bootstrap-swconfig
--- /dev/null
+---
+# ============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: Delete outdated engine provisioner files and folders
+ file:
+ path: "{{ item }}"
+ state: absent
+ with_items:
+ - "{{ engine_workspace }}/offline/git/engine/engine/provisioner"
+ - "{{ engine_workspace }}/offline/git/engine/engine/inventory/group_vars/all/{{ provisioner_type }}.yaml"
+
+- name: Clone engine provisioner repository
+ git:
+ repo: "{{ engine_workspace }}/offline/git/engine-{{ provisioner_type }}"
+ dest: "{{ engine_workspace }}/offline/git/engine/engine/provisioner"
+ version: "{{ provisioners[provisioner_type].version }}"
+ force: true
+
+- name: Copy engine provisioner vars file into group_vars
+ copy:
+ src: "{{ engine_workspace }}/offline/git/engine-{{ provisioner_type }}/vars/{{ provisioner_type }}.yaml"
+ dest: "{{ engine_workspace }}/offline/git/engine/engine/inventory/group_vars/all/{{ provisioner_type }}.yaml"
+ force: true
+
+- name: Delete outdated engine installer vars files from group_vars
+ file:
+ path: "{{ item }}"
+ state: absent
+ with_items:
+ - "{{ engine_workspace }}/offline/git/engine/engine/installer"
+ - "{{ engine_workspace }}/offline/git/engine/engine/inventory/group_vars/all/{{ installer_type }}.yaml"
+
+- name: Clone engine installer repository
+ git:
+ repo: "{{ engine_workspace }}/offline/git/engine-{{ installer_type }}"
+ dest: "{{ engine_workspace }}/offline/git/engine/engine/installer"
+ version: "{{ installer[installer_type].version }}"
+ force: true
+
+- name: Copy engine installer vars file into group_vars
+ copy:
+ src: "{{ engine_workspace }}/offline/git/engine-{{ installer_type }}/vars/{{ installer_type }}.yaml"
+ dest: "{{ engine_workspace }}/offline/git/engine/engine/inventory/group_vars/all/{{ installer_type }}.yaml"
+ force: true
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+---
+# ============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: Delete outdated engine provisioner files and folders
+ file:
+ path: "{{ item }}"
+ state: absent
+ with_items:
+ - "{{ engine_path }}/engine/provisioner"
+ - "{{ engine_path }}/engine/inventory/group_vars/all/{{ provisioner_type }}.yaml"
+
+- name: Clone engine provisioner repository
+ git:
+ repo: "{{ provisioners[provisioner_type].src }}"
+ dest: "{{ engine_path }}/engine/provisioner"
+ version: "{{ provisioners[provisioner_type].version }}"
+ refspec: "{{ provisioners[provisioner_type].refspec | default(omit) }}"
+ force: true
+ environment:
+ http_proxy: "{{ lookup('env','http_proxy') }}"
+ https_proxy: "{{ lookup('env','https_proxy') }}"
+ no_proxy: "{{ lookup('env','no_proxy') }}"
+
+- name: Copy engine provisioner vars file into group_vars
+ copy:
+ src: "{{ engine_path }}/engine/provisioner/vars/{{ provisioner_type }}.yaml"
+ dest: "{{ engine_path }}/engine/inventory/group_vars/all/{{ provisioner_type }}.yaml"
+ force: true
+
+- name: Delete outdated engine installer files and folders
+ file:
+ path: "{{ item }}"
+ state: absent
+ with_items:
+ - "{{ engine_path }}/engine/installer"
+ - "{{ engine_path }}/engine/inventory/group_vars/all/{{ installer_type }}.yaml"
+
+- name: Clone engine installer repository
+ git:
+ repo: "{{ installers[installer_type].src }}"
+ dest: "{{ engine_path }}/engine/installer"
+ version: "{{ installers[installer_type].version }}"
+ refspec: "{{ installers[installer_type].refspec | default(omit) }}"
+ force: true
+ environment:
+ http_proxy: "{{ lookup('env','http_proxy') }}"
+ https_proxy: "{{ lookup('env','https_proxy') }}"
+ no_proxy: "{{ lookup('env','no_proxy') }}"
+
+- name: Copy engine installer vars file into group_vars
+ copy:
+ src: "{{ engine_path }}/engine/installer/vars/{{ installer_type }}.yaml"
+ dest: "{{ engine_path }}/engine/inventory/group_vars/all/{{ installer_type }}.yaml"
+ force: true
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+---
+# ============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: Set distribution
+ set_fact:
+ distro: "{{ ansible_distribution | lower }}{{ ansible_distribution_version | replace('.','') }}"
+
+- name: Log distribution to console
+ debug:
+ msg: 'Set distribution to {{ distro }}'
+
+- name: Fail if distribution is not valid for stack '{{ stack_type }}'
+ fail:
+ msg: "'{{ distro }}' is not a valid distribution for stack '{{ stack_type }}'"
+ when: distro not in distros
+
+- name: Set provisioner type
+ set_fact:
+ provisioner_type: "{{ details.type is defined | ternary('bifrost', 'heat') }}"
+
+- name: Log provisioner type to console
+ debug:
+ msg: 'Set provisioner type to {{ provisioner_type }}'
+
+- name: Fail if the selected provisioner is not valid for stack '{{ stack_type }}'
+ fail:
+ msg: "'{{ provisioner_type }}' is not a valid provisioner for stack '{{ stack_type }}'"
+ when: provisioner_type not in provisioners
+
+- name: Set installer type
+ set_fact:
+ installer_type: 'kubespray'
+ when: deploy_scenario is search('k8-')
+
+- name: Log installer type to console
+ debug:
+ msg: 'Set installer type to {{ installer_type }}'
+
+- name: Fail if the selected installer is not valid for stack '{{ stack_type }}'
+ fail:
+ msg: "'{{ installer_type }}' is not a valid installer for stack '{{ stack_type }}'"
+ when: installer_type not in installers
+
+- name: Log deploy scenario to console
+ debug:
+ msg: 'Set deploy scenario to {{ deploy_scenario }}'
+
+- name: Fail if the deploy scenario is not valid for stack '{{ stack_type }}'
+ fail:
+ msg: "'{{ deploy_scenario }}' is not valid for stack '{{ stack_type }}'"
+ when: deploy_scenario not in scenarios
+
+# NOTE (fdegir): as we determine things dynamically, we need to record variables in order
+# for them to become available subsequent tasks, roles, playbooks
+- name: Record deployment variables to deployment variables file
+ blockinfile:
+ path: "{{ deployment_vars_file }}"
+ state: present
+ create: true
+ block: |
+ distro: "{{ distro }}"
+ provisioner_type: "{{ provisioner_type }}"
+ installer_type: "{{ installer_type }}"
+ marker: "# {mark} ANSIBLE MANAGED BLOCK engine-kubernetes"
+
+- name: Reload deployment variables
+ include_vars: "{{ deployment_vars_file }}"
+
+# NOTE (fdegir): Prepare provisioner and installer
+- name: Prepare provisioner and installer for '{{ execution_mode }}'
+ include_tasks: "configure-{{ execution_mode }}.yaml"
+
+# vim: set ts=2 sw=2 expandtab:
--- /dev/null
+---
+# ============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=========================================================
+
+distros:
+ - ubuntu1804
+
+# NOTE (fdegir): versions point to poc branch
+provisioners:
+ bifrost:
+ scm: git
+ src: ssh://localhost:47821/home/fdegir/repos/poc-nordix/bifrost
+ version: "{{ lookup('env', 'NORDIX_BIFROST_VERSION') | default('poc', true) }}"
+ heat:
+ scm: git
+ src: ssh://localhost:47821/home/fdegir/repos/poc-nordix/heat
+ version: "{{ lookup('env', 'NORDIX_HEAT_VERSION') | default('poc', true) }}"
+
+installers:
+ kubespray:
+ scm: git
+ src: ssh://localhost:47821/home/fdegir/repos/poc-nordix/kubespray
+ version: "{{ lookup('env', 'NORDIX_KUBESPRAY_VERSION') | default('poc', true) }}"
+
+apps:
+ - ceph
+ - prometheus
+
+scenarios:
+ k8-multus-plugins:
+ curated_apps:
+ - ceph
+ - prometheus
+
+# vim: set ts=2 sw=2 expandtab: