Update engine openstack stack to adapt SOF
This change introduces openstack stack for engine in order to package,
deploy, and test stacks independently from engine core.
Checklist:
- [X] Move packaging functionality from installer to stack
- [X] Enable online deployment with scenarios
- [X] Enable offline deployment with scenarios
- [X] Move scenarios from respective installer to stack
- [X] Move scenario and common pre/post Install operations from respective installer to stack
Depends-On: I13a8a066932b74fab8da7c4c19a78c7fded098bd
Signed-off-by: eprasad <prasad.mukhedkar@est.tech>
Change-Id: Ia0bb0b386faf17aad76dc65224aba597e0d82ead
diff --git a/playbooks/bootstrap-swconfig.yaml b/playbooks/bootstrap-swconfig.yaml
new file mode 100644
index 0000000..bd8d24f
--- /dev/null
+++ b/playbooks/bootstrap-swconfig.yaml
@@ -0,0 +1,28 @@
+---
+# ============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
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/package.yaml b/playbooks/package.yaml
new file mode 100644
index 0000000..1cf4c34
--- /dev/null
+++ b/playbooks/package.yaml
@@ -0,0 +1,28 @@
+---
+# ============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: package
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/postinstall.yaml b/playbooks/postinstall.yaml
new file mode 100644
index 0000000..bce4584
--- /dev/null
+++ b/playbooks/postinstall.yaml
@@ -0,0 +1,28 @@
+---
+# ============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=========================================================
+# run common post-deployment tasks
+- hosts: localhost
+ connection: local
+ gather_facts: true
+ become: false
+
+ roles:
+ - role: postinstall
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/preinstall.yaml b/playbooks/preinstall.yaml
new file mode 100644
index 0000000..eae8006
--- /dev/null
+++ b/playbooks/preinstall.yaml
@@ -0,0 +1,21 @@
+---
+# ============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=========================================================
+# NOTE: this is placeholder playbook for installer common preinstall operations
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/prepare-artifacts.yaml b/playbooks/prepare-artifacts.yaml
new file mode 100644
index 0000000..0132d65
--- /dev/null
+++ b/playbooks/prepare-artifacts.yaml
@@ -0,0 +1,30 @@
+---
+# ============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: jumphost
+ gather_facts: true
+ become: false
+
+ tasks:
+ - name: Prepare artifacts for offline deployment
+ include_role:
+ name: prepare-artifacts
+ when: execution_mode == "offline-deployment"
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/bootstrap-swconfig/tasks/configure-offline-deployment.yaml b/playbooks/roles/bootstrap-swconfig/tasks/configure-offline-deployment.yaml
new file mode 100644
index 0000000..4d57285
--- /dev/null
+++ b/playbooks/roles/bootstrap-swconfig/tasks/configure-offline-deployment.yaml
@@ -0,0 +1,66 @@
+---
+# ============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"
+
+- block:
+ - 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
+ when: provisioners is defined
+
+- 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"
+
+- block:
+ - name: Clone engine installer repository
+ git:
+ repo: "{{ engine_workspace }}/offline/git/engine-{{ installer_type }}"
+ dest: "{{ engine_workspace }}/offline/git/engine/engine/installer"
+ version: "{{ installers[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
+ when: installers is defined
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/bootstrap-swconfig/tasks/configure-online-deployment.yaml b/playbooks/roles/bootstrap-swconfig/tasks/configure-online-deployment.yaml
new file mode 100644
index 0000000..75f3db5
--- /dev/null
+++ b/playbooks/roles/bootstrap-swconfig/tasks/configure-online-deployment.yaml
@@ -0,0 +1,76 @@
+---
+# ============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"
+
+- block:
+ - 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
+ when: provisioners is defined
+
+- 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"
+
+- block:
+ - 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
+ when: installers is defined
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/bootstrap-swconfig/tasks/main.yaml b/playbooks/roles/bootstrap-swconfig/tasks/main.yaml
new file mode 100644
index 0000000..3fc9d74
--- /dev/null
+++ b/playbooks/roles/bootstrap-swconfig/tasks/main.yaml
@@ -0,0 +1,89 @@
+---
+# ============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: 'kolla'
+ when: deploy_scenario is search('os-')
+
+- 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-openstack"
+
+- 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:
diff --git a/playbooks/roles/package/defaults/main.yaml b/playbooks/roles/package/defaults/main.yaml
new file mode 100644
index 0000000..2a47fe4
--- /dev/null
+++ b/playbooks/roles/package/defaults/main.yaml
@@ -0,0 +1,183 @@
+---
+# ============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=========================================================
+
+# locations of the packaged dependencies
+pkg_folder: "{{ offline_pkg_folder }}/pkg"
+dib_folder: "{{ offline_pkg_folder }}/dib"
+git_folder: "{{ offline_pkg_folder }}/git"
+binaries_folder: "{{ offline_pkg_folder }}/binaries"
+containers_folder: "{{ offline_pkg_folder }}/containers"
+pip_folder: "{{ offline_pkg_folder }}/pip"
+
+# some images require architecture
+image_arch: amd64
+
+dib_images:
+ - https://artifactory.nordix.org/artifactory/cloud-infra/dib/deployment_image/ubuntu1804/deployment_image.qcow2
+ - https://artifactory.nordix.org/artifactory/cloud-infra/dib/ipa_image/coreos/ipa.initramfs
+ - https://artifactory.nordix.org/artifactory/cloud-infra/dib/ipa_image/coreos/ipa.kernel
+
+kolla_docker_repo: "kolla"
+
+kolla_images:
+ - neutron-server
+ - neutron-l3-agent
+ - nova-novncproxy
+ - neutron-metadata-agent
+ - neutron-openvswitch-agent
+ - neutron-dhcp-agent
+ - nova-api
+ - nova-compute
+ - nova-conductor
+ - nova-libvirt
+ - nova-scheduler
+ - nova-ssh
+ - heat-api
+ - heat-engine
+ - heat-api-cfn
+ - placement-api
+ - keystone-ssh
+ - keystone-fernet
+ - keystone
+ - cinder-api
+ - cinder-volume
+ - cinder-backup
+ - glance-api
+ - cinder-scheduler
+ - horizon
+ - openvswitch-vswitchd
+ - openvswitch-db-server
+ - mariadb
+ - iscsid
+ - kolla-toolbox
+ - cron
+ - memcached
+ - fluentd
+ - rabbitmq
+ - tgtd
+ - chrony
+ - ceph-mon
+ - ceph-osd
+ - ceph-mgr
+
+other_images:
+ docker-registry:
+ repo: docker.io/registry
+ tag: "{{ docker_registry_version }}"
+
+repositories:
+ # NOTE (fdegir): OpenDev Git Repositories - Using Nordix Mirrors
+ bifrost:
+ repo: "https://gerrit.nordix.org/opendev/openstack/bifrost"
+ dest: "bifrost"
+ version: "{{ bifrost_version }}"
+ diskimage-builder:
+ repo: "https://gerrit.nordix.org/opendev/openstack/diskimage-builder"
+ dest: "diskimage-builder"
+ version: "{{ diskimage_builder_version }}"
+ ironic:
+ repo: "https://gerrit.nordix.org/opendev/openstack/ironic"
+ dest: "ironic"
+ version: "{{ ironic_version }}"
+ ironic-inspector:
+ repo: "https://gerrit.nordix.org/opendev/openstack/ironic-inspector"
+ dest: "ironic-inspector"
+ version: "{{ ironic_inspector_version }}"
+ ironic-python-agent:
+ repo: "https://gerrit.nordix.org/opendev/openstack/ironic-python-agent"
+ dest: "ironic-python-agent"
+ version: "{{ ironic_python_agent_version }}"
+ ironic-python-agent-builder:
+ repo: "https://gerrit.nordix.org/opendev/openstack/ironic-python-agent-builder"
+ dest: "ironic-python-agent-builder"
+ version: "{{ ironic_python_agent_builder_version }}"
+ ironic-staging-drivers:
+ repo: "https://gerrit.nordix.org/opendev/x/ironic-staging-drivers"
+ dest: "ironic-staging-drivers"
+ version: "{{ ironic_staging_drivers_version }}"
+ keystone:
+ repo: "https://gerrit.nordix.org/opendev/openstack/keystone"
+ dest: "keystone"
+ version: "{{ keystone_version }}"
+ openstacksdk:
+ repo: "https://gerrit.nordix.org/opendev/openstack/openstacksdk"
+ dest: "openstacksdk"
+ version: "{{ openstacksdk_version }}"
+ python-ironicclient:
+ repo: "https://gerrit.nordix.org/opendev/openstack/python-ironicclient"
+ dest: "python-ironicclient"
+ version: "{{ python_ironicclient_version }}"
+ python-ironic-inspector-client:
+ repo: "https://gerrit.nordix.org/opendev/openstack/python-ironic-inspector-client"
+ dest: "python-ironic-inspector-client"
+ version: "{{ python_ironic_inspector_client_version }}"
+ requirements:
+ repo: "https://gerrit.nordix.org/opendev/openstack/requirements"
+ dest: "requirements"
+ version: "{{ requirements_version }}"
+ shade:
+ repo: "https://gerrit.nordix.org/opendev/openstack/shade"
+ dest: "shade"
+ version: "{{ shade_version }}"
+ sushy:
+ repo: "https://gerrit.nordix.org/opendev/openstack/sushy"
+ dest: "sushy"
+ version: "{{ sushy_version }}"
+ # NOTE (fdegir): Kolla ansible Git respositories
+ kolla-ansible:
+ repo: "https://github.com/openstack/kolla-ansible"
+ dest: "kolla-ansible"
+ version: "{{ kolla_ansible_version }}"
+ # NOTE (fdegir): Nordix Git Repositories
+ engine:
+ repo: "https://gerrit.nordix.org/infra/engine.git"
+ dest: "engine"
+ version: "{{ lookup('env', 'NORDIX_ENGINE_VERSION') | default('master', true) }}"
+ hwconfig:
+ repo: "https://gerrit.nordix.org/infra/hwconfig.git"
+ dest: "hwconfig"
+ version: "{{ lookup('env', 'NORDIX_HWCONFIG_VERSION') | default('master', true) }}"
+ swconfig:
+ repo: "https://gerrit.nordix.org/infra/swconfig.git"
+ dest: "swconfig"
+ version: "{{ lookup('env', 'NORDIX_SWCONFIG_VERSION') | default('master', true) }}"
+ test:
+ repo: "https://gerrit.nordix.org/infra/test.git"
+ dest: "test"
+ version: "{{ lookup('env', 'NORDIX_TEST_VERSION') | default('master', true) }}"
+ # NOTE (fdegir): Engine provisioner and installer repos will be prepended with engine
+ # in order to prevent name clashes during packaging
+ # NOTE (fdegir): stack git details are inherited from engine/inventory/group_vars/all/sdf.yaml
+ engine-openstack:
+ repo: "{{ stacks['openstack'].src }}"
+ dest: "engine-openstack"
+ version: "{{ stacks['openstack'].version }}"
+ refspec: "{{ stacks['openstack'].refspec | default(omit) }}"
+ # NOTE (eprasad): bifrost, heat and kolla git details are inherited from openstack/vars/openstack.yaml
+ engine-bifrost:
+ repo: "{{ provisioners['bifrost'].src }}"
+ dest: "engine-bifrost"
+ version: "{{ provisioners['bifrost'].version }}"
+ refspec: "{{ provisioners['bifrost'].refspec | default(omit) }}"
+ engine-kolla:
+ repo: "{{ installers['kolla'].src }}"
+ dest: "engine-kolla"
+ version: "{{ installers['kolla'].version }}"
+ refspec: "{{ installers['kolla'].refspec | default(omit) }}"
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/package/files/build.sh b/playbooks/roles/package/files/build.sh
new file mode 100755
index 0000000..c28264d
--- /dev/null
+++ b/playbooks/roles/package/files/build.sh
@@ -0,0 +1,54 @@
+#!/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
+
+export OFFLINE_PKG_FOLDER="${OFFLINE_PKG_FOLDER:-/tmp/offline-package}"
+export OFFLINE_PKG_FILE="${OFFLINE_PKG_FILE:-/tmp/offline-package.tgz}"
+
+# NOTE (fdegir): In order to package and test the change for offline deployment,
+# we need to include the change/patch within the package since that is what should
+# be used during the deployment phase.
+# check if we are running as part of CI verify job
+GERRIT_PROJECT="${GERRIT_PROJECT:-}"
+if [[ "$GERRIT_PROJECT" == "infra/engine" ]]; then
+ REPO_GIT_URL="https://gerrit.nordix.org/infra/engine.git"
+ echo "Info : Running in CI - infra/engine patch will be packaged for testing."
+ echo " Checking out the change/patch $GERRIT_REFSPEC for $REPO_GIT_URL"
+ # navigate to the folder and checkout the patch
+ cd "$OFFLINE_PKG_FOLDER/git/engine"
+ git fetch "$REPO_GIT_URL" "$GERRIT_REFSPEC" && git checkout FETCH_HEAD
+fi
+
+# compress & archive offline dependencies
+tar -C "$OFFLINE_PKG_FOLDER" -czf "$OFFLINE_PKG_FILE" .
+
+# remove intermediate offline pkg folder
+rm -rf "$OFFLINE_PKG_FOLDER"
+
+# create self extracting installer
+cat /tmp/decompress.sh "$OFFLINE_PKG_FILE" > "$OFFLINE_INSTALLER_FILE"
+chmod +x "$OFFLINE_INSTALLER_FILE"
+
+# remove intermediate offline pkg file
+rm -rf "$OFFLINE_PKG_FILE"
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/package/files/decompress.sh b/playbooks/roles/package/files/decompress.sh
new file mode 100755
index 0000000..25c7570
--- /dev/null
+++ b/playbooks/roles/package/files/decompress.sh
@@ -0,0 +1,55 @@
+#!/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
+
+cat <<EOF
+#---------------------------------------------------#
+# Self Extracting Installer #
+#---------------------------------------------------#
+User : $USER
+Hostname : $HOSTNAME
+Host OS : $(source /etc/os-release &> /dev/null || source /usr/lib/os-release &> /dev/null; echo "${PRETTY_NAME}")
+IP : $(hostname -I | cut -d' ' -f1)
+#---------------------------------------------------#
+Info : Please wait while extracting dependencies.
+ This might take a while.
+#---------------------------------------------------#
+EOF
+
+ENGINE_WORKSPACE=/opt/engine
+DESTINATION_FOLDER="$ENGINE_WORKSPACE/offline"
+export ENGINE_WORKSPACE DESTINATION_FOLDER
+
+# NOTE (fdegir): we need to clean things up in order to prevent side effects from leftovers
+sudo rm -rf "$ENGINE_WORKSPACE"
+sudo mkdir -p "$DESTINATION_FOLDER"
+sudo chown -R "$USER":"$USER" "$ENGINE_WORKSPACE"
+
+ARCHIVE=$(awk '/^__ARCHIVE_BELOW__/ {print NR + 1; exit 0; }' "$0")
+
+tail -n+"$ARCHIVE" "$0" | tar -xz -C "$DESTINATION_FOLDER"
+
+cd "$DESTINATION_FOLDER"
+./install.sh
+
+exit 0
+__ARCHIVE_BELOW__
diff --git a/playbooks/roles/package/files/install.sh b/playbooks/roles/package/files/install.sh
new file mode 100755
index 0000000..a5c1ccb
--- /dev/null
+++ b/playbooks/roles/package/files/install.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# TODO (fdegir): This script could be enhanced to provide full installation functionality
+# by parsing arguments and executing actual engine deploy.sh with the arguments but left for later
+echo "Info : Dependencies are extracted to $DESTINATION_FOLDER"
+echo "Info : Please navigate to $DESTINATION_FOLDER/git/engine/engine folder and issue deployment command"
+echo " You can get help about the engine usage by issuing command ./deploy.sh -h"
+echo " Do not forget to specify PDF and IDF file locations using -p and -i arguments!"
+echo "Info : Done!"
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/package/tasks/binaries.yaml b/playbooks/roles/package/tasks/binaries.yaml
new file mode 100644
index 0000000..15fbf9e
--- /dev/null
+++ b/playbooks/roles/package/tasks/binaries.yaml
@@ -0,0 +1,28 @@
+---
+# ============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: Create directory to store openstack binaries
+ file:
+ path: "{{ binaries_folder }}"
+ state: "{{ item }}"
+ with_items:
+ - absent
+ - directory
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/package/tasks/containers.yaml b/playbooks/roles/package/tasks/containers.yaml
new file mode 100644
index 0000000..f623bcc
--- /dev/null
+++ b/playbooks/roles/package/tasks/containers.yaml
@@ -0,0 +1,73 @@
+---
+# ============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: Create directory to store container images
+ file:
+ path: "{{ containers_folder }}"
+ state: "{{ item }}"
+ with_items:
+ - absent
+ - directory
+
+- name: Pull kolla container images
+ command: "docker pull {{ kolla_docker_repo }}/{{ os_distro }}-{{ os_kolla_install_type }}-{{ image }}:{{ openstack_version }}"
+ loop: "{{ kolla_images }}"
+ loop_control:
+ loop_var: image
+ become: true
+ changed_when: false
+
+- name: Pull other container images
+ command: "docker pull {{ other_images[item.key].repo }}:{{ other_images[item.key].tag }}"
+ with_dict: "{{ other_images }}"
+ become: true
+ changed_when: false
+
+- name: Save kolla container images
+ command: |-
+ docker save {{ kolla_docker_repo }}/{{ os_distro }}-{{ os_kolla_install_type }}-{{ image }}:{{ openstack_version }}
+ -o {{ kolla_docker_repo }}_{{ os_distro }}-{{ os_kolla_install_type }}-{{ image }}_{{ openstack_version }}.tar
+ loop: "{{ kolla_images }}"
+ loop_control:
+ loop_var: image
+ args:
+ chdir: "{{ containers_folder }}"
+ become: true
+ changed_when: false
+
+- name: Save other container images
+ command: |-
+ docker save {{ other_images[item.key].repo }}:{{ other_images[item.key].tag }}
+ -o {{ other_images[item.key].repo | replace('/', '_') }}_{{ other_images[item.key].tag }}.tar
+ with_dict: "{{ other_images }}"
+ args:
+ chdir: "{{ containers_folder }}"
+ become: true
+ changed_when: false
+
+# NOTE (fdegir): archive fails due to wrong permissions so we fix them
+- name: Fix container image permissions
+ file:
+ path: "{{ containers_folder }}"
+ state: directory
+ recurse: true
+ mode: 0755
+ become: true
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/package/tasks/dib.yaml b/playbooks/roles/package/tasks/dib.yaml
new file mode 100644
index 0000000..887977b
--- /dev/null
+++ b/playbooks/roles/package/tasks/dib.yaml
@@ -0,0 +1,35 @@
+---
+# ============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: Create directory to store images used for provisioning
+ file:
+ path: "{{ dib_folder }}"
+ state: "{{ item }}"
+ with_items:
+ - absent
+ - directory
+
+- name: Download distro images used for provisioning nodes
+ get_url:
+ url: "{{ item }}"
+ dest: "{{ dib_folder }}"
+ force: true
+ loop: "{{ dib_images }}"
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/package/tasks/git.yaml b/playbooks/roles/package/tasks/git.yaml
new file mode 100644
index 0000000..60ddff8
--- /dev/null
+++ b/playbooks/roles/package/tasks/git.yaml
@@ -0,0 +1,41 @@
+---
+# ============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: Create directory to store git repositories
+ file:
+ path: "{{ git_folder }}"
+ state: "{{ item }}"
+ with_items:
+ - absent
+ - directory
+
+- name: Clone repositories
+ git:
+ repo: "{{ repositories[item.key].repo }}"
+ dest: "{{ git_folder }}/{{ repositories[item.key].dest }}"
+ version: "{{ repositories[item.key].version }}"
+ refspec: "{{ repositories[item.key].refspec | default(omit) }}"
+ force: true
+ with_dict: "{{ repositories }}"
+ environment:
+ http_proxy: "{{ lookup('env','http_proxy') }}"
+ https_proxy: "{{ lookup('env','https_proxy') }}"
+ no_proxy: "{{ lookup('env','no_proxy') }}"
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/package/tasks/install-packages-Debian.yml b/playbooks/roles/package/tasks/install-packages-Debian.yml
new file mode 100644
index 0000000..b69f4bd
--- /dev/null
+++ b/playbooks/roles/package/tasks/install-packages-Debian.yml
@@ -0,0 +1,61 @@
+---
+# ============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: Load distribution variables
+ include_vars: '{{ ansible_os_family }}.yaml'
+
+- name: Add docker apt key
+ apt_key:
+ url: https://download.docker.com/linux/ubuntu/gpg
+ state: present
+ become: true
+
+# NOTE(fdegir): ansible apt_repository gives segmentation fault so failling back to command
+- name: Add docker apt repository
+ command: |-
+ add-apt-repository \
+ "deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable"
+ changed_when: false
+ become: true
+
+- name: Run apt update
+ apt:
+ update_cache: true
+ become: true
+
+- name: Install packages
+ apt:
+ name: "{{ packages }}"
+ state: "{{ item }}"
+ force: true
+ install_recommends: true
+ autoremove: true
+ update_cache: true
+ with_items:
+ - absent
+ - present
+ become: true
+
+- name: Restart docker service
+ service:
+ name: "{{ docker_service_name }}"
+ state: restarted
+ become: true
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/package/tasks/main.yaml b/playbooks/roles/package/tasks/main.yaml
new file mode 100644
index 0000000..792c962
--- /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 openstack services kolla container images
+- name: Fetch kolla 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:
diff --git a/playbooks/roles/package/tasks/pip.yaml b/playbooks/roles/package/tasks/pip.yaml
new file mode 100644
index 0000000..a4a4642
--- /dev/null
+++ b/playbooks/roles/package/tasks/pip.yaml
@@ -0,0 +1,40 @@
+---
+# ============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: Create directory to store pip packages
+ file:
+ path: "{{ pip_folder }}"
+ state: "{{ item }}"
+ with_items:
+ - absent
+ - directory
+
+- name: Download pip packages using requirements.txt file
+ command: "pip download -r {{ engine_path }}/requirements.txt --no-cache"
+ changed_when: false
+ args:
+ chdir: "{{ pip_folder }}"
+
+- name: Copy pip.conf
+ template:
+ src: pip.conf.j2
+ dest: "{{ pip_folder }}/pip.conf"
+ force: true
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/package/tasks/pkg-Debian.yaml b/playbooks/roles/package/tasks/pkg-Debian.yaml
new file mode 100644
index 0000000..f844bf9
--- /dev/null
+++ b/playbooks/roles/package/tasks/pkg-Debian.yaml
@@ -0,0 +1,53 @@
+---
+# ============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: Create directory to store apt packages
+ file:
+ path: "{{ pkg_folder }}/amd64"
+ state: "{{ item }}"
+ with_items:
+ - absent
+ - directory
+
+# NOTE (fdegir): docker version is taken and updated from engine versions file
+- name: Generate ubuntu.list file from template
+ template:
+ src: ubuntu.list.j2
+ dest: /tmp/ubuntu.list
+ force: true
+
+- name: Download apt packages using ubuntu.list file
+ shell: |
+ set -o pipefail
+ apt download $(grep -vE "^\s*#" /tmp/ubuntu.list | tr "\n" " ")
+ changed_when: false
+ args:
+ executable: /bin/bash
+ chdir: "{{ pkg_folder }}/amd64"
+
+- name: Generate Packages.gz file for apt packages
+ shell: |
+ set -o pipefail
+ dpkg-scanpackages amd64 | gzip -9c > amd64/Packages.gz
+ args:
+ executable: /bin/bash
+ creates: "{{ pkg_folder }}/amd64/Packages.gz"
+ chdir: "{{ pkg_folder }}"
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/package/tasks/prepare-packaging.yaml b/playbooks/roles/package/tasks/prepare-packaging.yaml
new file mode 100644
index 0000000..cca35b0
--- /dev/null
+++ b/playbooks/roles/package/tasks/prepare-packaging.yaml
@@ -0,0 +1,88 @@
+---
+# ============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: Create temporary folder to clone engine repositories
+ tempfile:
+ prefix: "engine."
+ state: directory
+ register: tempdir
+
+- block:
+ - name: Clone engine provisioner repositories
+ git:
+ repo: "{{ provisioners[provisioner.key].src }}"
+ dest: "{{ tempdir.path }}/{{ provisioner.key }}"
+ version: "{{ provisioners[provisioner.key].version }}"
+ refspec: "{{ provisioners[provisioner.key].refspec | default(omit) }}"
+ force: true
+ with_dict: "{{ provisioners }}"
+ loop_control:
+ loop_var: provisioner
+ 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: "{{ tempdir.path }}/{{ provisioner.key }}/vars/{{ provisioner.key }}.yaml"
+ dest: "{{ engine_path }}/engine/inventory/group_vars/all/{{ provisioner.key }}.yaml"
+ force: true
+ with_dict: "{{ provisioners }}"
+ loop_control:
+ loop_var: provisioner
+ when: provisioners is defined
+
+- block:
+ - name: Clone engine installer repositories
+ git:
+ repo: "{{ installers[installer.key].src }}"
+ dest: "{{ tempdir.path }}/{{ installer.key }}"
+ version: "{{ installers[installer.key].version }}"
+ refspec: "{{ installers[installer.key].refspec | default(omit) }}"
+ force: true
+ with_dict: "{{ installers }}"
+ loop_control:
+ loop_var: installer
+ 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: "{{ tempdir.path }}/{{ installer.key }}/vars/{{ installer.key }}.yaml"
+ dest: "{{ engine_path }}/engine/inventory/group_vars/all/{{ installer.key }}.yaml"
+ force: true
+ with_dict: "{{ installers }}"
+ loop_control:
+ loop_var: installer
+ when: installers is defined
+
+- name: Delete temporary folder
+ file:
+ path: "{{ tempdir.path }}"
+ state: absent
+ force: true
+
+- name: Include vars from collected provisioners and installers vars files
+ include_vars:
+ dir: "{{ engine_path }}/engine/inventory/group_vars/all"
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/package/templates/pip.conf.j2 b/playbooks/roles/package/templates/pip.conf.j2
new file mode 100644
index 0000000..9ab40ef
--- /dev/null
+++ b/playbooks/roles/package/templates/pip.conf.j2
@@ -0,0 +1,4 @@
+[global]
+timeout=10
+find-links={{ engine_workspace }}/offline/pip
+no-index=yes
diff --git a/playbooks/roles/package/templates/ubuntu.list.j2 b/playbooks/roles/package/templates/ubuntu.list.j2
new file mode 100644
index 0000000..0b9fb77
--- /dev/null
+++ b/playbooks/roles/package/templates/ubuntu.list.j2
@@ -0,0 +1,841 @@
+accountsservice
+acl
+acpid
+adduser
+amd64-microcode
+apparmor
+apport
+apport-symptoms
+apt
+apt-transport-https
+apt-utils
+at
+augeas-lenses
+base-files
+base-passwd
+bash
+bash-completion
+bc
+bcache-tools
+bind9-host
+binutils
+binutils-common:amd64
+binutils-x86-64-linux-gnu
+bridge-utils
+bsdmainutils
+bsdutils
+btrfs-progs
+btrfs-tools
+build-essential
+busybox
+busybox-initramfs
+busybox-static
+byobu
+bzip2
+ca-certificates
+chrony
+cloud-guest-utils
+cloud-image-utils
+cloud-init
+cloud-initramfs-copymods
+cloud-initramfs-dyn-netconf
+cloud-utils
+command-not-found
+command-not-found-data
+console-setup
+console-setup-linux
+coreutils
+cpio
+cpp
+cpp-7
+cpu-checker
+crda
+cron
+cryptsetup
+cryptsetup-bin
+curl
+dash
+dbus
+dconf-gsettings-backend:amd64
+dconf-service
+debconf
+debconf-i18n
+debianutils
+debootstrap
+dh-python
+diffutils
+dirmngr
+distro-info-data
+dmeventd
+dmidecode
+dmsetup
+dns-root-data
+dnsmasq
+dnsmasq-base
+dnsutils
+dosfstools
+dpkg
+dpkg-dev
+e2fsprogs
+eatmydata
+ebtables
+ed
+efibootmgr
+eject
+ethtool
+fakeroot
+fdisk
+file
+findutils
+fontconfig
+fontconfig-config
+fonts-dejavu-core
+fonts-ubuntu-console
+freeipmi-common
+friendly-recovery
+ftp
+fuse
+g++
+g++-7
+galera-3
+gawk
+gcc
+gcc-7
+gcc-7-base:amd64
+gcc-8-base:amd64
+gdisk
+genisoimage
+geoip-database
+gettext-base
+gir1.2-glib-2.0:amd64
+gir1.2-harfbuzz-0.0:amd64
+git
+git-man
+glib-networking-common
+glib-networking-services
+glib-networking:amd64
+gnupg
+gnupg-agent
+gnupg-l10n
+gnupg-utils
+gpg
+gpg-agent
+gpg-wks-client
+gpg-wks-server
+gpgconf
+gpgsm
+gpgv
+grep
+groff-base
+grub-common
+grub-efi-amd64
+grub-efi-amd64-bin
+grub-efi-amd64-signed
+grub-gfxpayload-lists
+grub-ipxe
+grub-legacy-ec2
+grub-pc
+grub-pc-bin
+grub2-common
+gsettings-desktop-schemas
+gstreamer1.0-plugins-base:amd64
+gstreamer1.0-plugins-good:amd64
+gstreamer1.0-x:amd64
+gzip
+hdparm
+hostname
+htop
+ibverbs-providers:amd64
+icu-devtools
+ifupdown
+inetutils-ping
+info
+init
+init-system-helpers
+initramfs-tools
+initramfs-tools-bin
+initramfs-tools-core
+install-info
+intel-microcode
+ipmitool
+iproute2
+iptables
+iputils-ping
+iputils-tracepath
+ipxe
+ipxe-qemu
+ipxe-qemu-256k-compat-efi-roms
+irqbalance
+isc-dhcp-client
+isc-dhcp-common
+iso-codes
+iucode-tool
+iw
+kbd
+keyboard-configuration
+keyutils
+klibc-utils
+kmod
+kpartx
+krb5-locales
+landscape-common
+language-pack-en
+language-pack-en-base
+language-selector-common
+less
+libaa1:amd64
+libaccountsservice0:amd64
+libacl1:amd64
+libaio1:amd64
+libalgorithm-diff-perl
+libalgorithm-diff-xs-perl
+libalgorithm-merge-perl
+libapparmor1:amd64
+libapt-inst2.0:amd64
+libapt-pkg5.0:amd64
+libargon2-0:amd64
+libasan4:amd64
+libasn1-8-heimdal:amd64
+libasound2-data
+libasound2:amd64
+libassuan0:amd64
+libasyncns0:amd64
+libatm1:amd64
+libatomic1:amd64
+libattr1:amd64
+libaudit-common
+libaudit1:amd64
+libaugeas0:amd64
+libavahi-client3:amd64
+libavahi-common-data:amd64
+libavahi-common3:amd64
+libavc1394-0:amd64
+libbind9-160:amd64
+libbinutils:amd64
+libblkid1:amd64
+libbluetooth3:amd64
+libbrlapi0.6:amd64
+libbsd0:amd64
+libbz2-1.0:amd64
+libc-bin
+libc-dev-bin
+libc6-dev:amd64
+libc6:amd64
+libcaca0:amd64
+libcacard0:amd64
+libcairo-gobject2:amd64
+libcairo2:amd64
+libcap-ng0:amd64
+libcap2-bin
+libcap2:amd64
+libcc1-0:amd64
+libcdparanoia0:amd64
+libcgi-fast-perl
+libcgi-pm-perl
+libcilkrts5:amd64
+libcom-err2:amd64
+libconfig-inifiles-perl
+libcryptsetup12:amd64
+libcurl3-gnutls:amd64
+libcurl4:amd64
+libdatrie1:amd64
+libdb5.3:amd64
+libdbd-mysql-perl
+libdbi-perl
+libdbus-1-3:amd64
+libdconf1:amd64
+libdebconfclient0:amd64
+libdevmapper-event1.02.1:amd64
+libdevmapper1.02.1:amd64
+libdns-export1100
+libdns1100:amd64
+libdpkg-perl
+libdrm-common
+libdrm2:amd64
+libdumbnet1:amd64
+libdv4:amd64
+libeatmydata1:amd64
+libedit2:amd64
+libefiboot1:amd64
+libefivar1:amd64
+libelf1:amd64
+libencode-locale-perl
+liberror-perl
+libestr0:amd64
+libevent-2.1-6:amd64
+libexpat1-dev:amd64
+libexpat1:amd64
+libext2fs2:amd64
+libfakeroot:amd64
+libfastjson4:amd64
+libfcgi-perl
+libfdisk1:amd64
+libfdt1:amd64
+libffi-dev:amd64
+libffi6:amd64
+libfile-copy-recursive-perl
+libfile-fcntllock-perl
+libflac8:amd64
+libfontconfig1:amd64
+libfreeipmi16
+libfreetype6:amd64
+libfribidi0:amd64
+libfuse2:amd64
+libgcc-7-dev:amd64
+libgcc1:amd64
+libgcrypt20:amd64
+libgd3:amd64
+libgdbm-compat4:amd64
+libgdbm5:amd64
+libgdk-pixbuf2.0-0:amd64
+libgdk-pixbuf2.0-bin
+libgdk-pixbuf2.0-common
+libgeoip1:amd64
+libgirepository-1.0-1:amd64
+libglib2.0-0:amd64
+libglib2.0-bin
+libglib2.0-data
+libglib2.0-dev-bin
+libglib2.0-dev:amd64
+libgmp10:amd64
+libgnutls30:amd64
+libgomp1:amd64
+libgpg-error0:amd64
+libgpm2:amd64
+libgraphite2-3:amd64
+libgraphite2-dev:amd64
+libgssapi-krb5-2:amd64
+libgssapi3-heimdal:amd64
+libgstreamer-plugins-base1.0-0:amd64
+libgstreamer-plugins-good1.0-0:amd64
+libgstreamer1.0-0:amd64
+libgudev-1.0-0:amd64
+libharfbuzz-dev:amd64
+libharfbuzz-gobject0:amd64
+libharfbuzz-icu0:amd64
+libharfbuzz0b:amd64
+libhcrypto4-heimdal:amd64
+libheimbase1-heimdal:amd64
+libheimntlm0-heimdal:amd64
+libhogweed4:amd64
+libhtml-parser-perl
+libhtml-tagset-perl
+libhtml-template-perl
+libhttp-date-perl
+libhttp-message-perl
+libhx509-5-heimdal:amd64
+libibverbs1:amd64
+libicu-dev
+libicu-le-hb-dev:amd64
+libicu-le-hb0:amd64
+libicu60:amd64
+libiculx60:amd64
+libidn11:amd64
+libidn2-0:amd64
+libiec61883-0:amd64
+libio-html-perl
+libip4tc0:amd64
+libip6tc0:amd64
+libiptc0:amd64
+libirs160:amd64
+libisc-export169:amd64
+libisc169:amd64
+libisccc160:amd64
+libisccfg160:amd64
+libiscsi7:amd64
+libisl19:amd64
+libisns0:amd64
+libitm1:amd64
+libjack-jackd2-0:amd64
+libjbig0:amd64
+libjemalloc1
+libjpeg-turbo8:amd64
+libjpeg8:amd64
+libjson-c3:amd64
+libk5crypto3:amd64
+libkeyutils1:amd64
+libklibc
+libkmod2:amd64
+libkrb5-26-heimdal:amd64
+libkrb5-3:amd64
+libkrb5support0:amd64
+libksba8:amd64
+libldap-2.4-2:amd64
+libldap-common
+liblocale-gettext-perl
+liblsan0:amd64
+liblvm2app2.2:amd64
+liblvm2cmd2.02:amd64
+liblwp-mediatypes-perl
+liblwres160:amd64
+liblxc-common
+liblxc1
+liblz4-1:amd64
+liblzma5:amd64
+liblzo2-2:amd64
+libmagic-mgc
+libmagic1:amd64
+libmnl0:amd64
+libmount1:amd64
+libmp3lame0:amd64
+libmpc3:amd64
+libmpdec2:amd64
+libmpfr6:amd64
+libmpg123-0:amd64
+libmpx2:amd64
+libmspack0:amd64
+libmysqlclient20:amd64
+libncurses5:amd64
+libncursesw5:amd64
+libnetcf1:amd64
+libnetfilter-conntrack3:amd64
+libnettle6:amd64
+libnewt0.52:amd64
+libnfnetlink0:amd64
+libnfsidmap2:amd64
+libnghttp2-14:amd64
+libnginx-mod-http-geoip
+libnginx-mod-http-image-filter
+libnginx-mod-http-xslt-filter
+libnginx-mod-mail
+libnginx-mod-stream
+libnih1:amd64
+libnl-3-200:amd64
+libnl-genl-3-200:amd64
+libnl-route-3-200:amd64
+libnorm1:amd64
+libnpth0:amd64
+libnspr4:amd64
+libnss-systemd:amd64
+libnss3:amd64
+libntfs-3g88
+libnuma1:amd64
+libogg0:amd64
+libopenipmi0
+libopus0:amd64
+liborc-0.4-0:amd64
+libp11-kit0:amd64
+libpam-cap:amd64
+libpam-modules-bin
+libpam-modules:amd64
+libpam-runtime
+libpam-systemd:amd64
+libpam0g:amd64
+libpango-1.0-0:amd64
+libpangocairo-1.0-0:amd64
+libpangoft2-1.0-0:amd64
+libparted2:amd64
+libpcap0.8:amd64
+libpci3:amd64
+libpciaccess0:amd64
+libpcre16-3:amd64
+libpcre3-dev:amd64
+libpcre32-3:amd64
+libpcre3:amd64
+libpcrecpp0v5:amd64
+libperl5.26:amd64
+libpgm-5.2-0:amd64
+libpipeline1:amd64
+libpixman-1-0:amd64
+libplymouth4:amd64
+libpng16-16:amd64
+libpolkit-agent-1-0:amd64
+libpolkit-backend-1-0:amd64
+libpolkit-gobject-1-0:amd64
+libpopt0:amd64
+libprocps6:amd64
+libproxy1v5:amd64
+libpsl5:amd64
+libpulse0:amd64
+libpython-dev:amd64
+libpython-stdlib:amd64
+libpython2.7-dev:amd64
+libpython2.7-minimal:amd64
+libpython2.7-stdlib:amd64
+libpython2.7:amd64
+libpython3-dev:amd64
+libpython3-stdlib:amd64
+libpython3.6-dev:amd64
+libpython3.6-minimal:amd64
+libpython3.6-stdlib:amd64
+libpython3.6:amd64
+libquadmath0:amd64
+librados2
+libraw1394-11:amd64
+librbd1
+librdmacm1:amd64
+libreadline5:amd64
+libreadline7:amd64
+libroken18-heimdal:amd64
+librtmp1:amd64
+libsamplerate0:amd64
+libsasl2-2:amd64
+libsasl2-modules-db:amd64
+libsasl2-modules:amd64
+libsdl1.2debian:amd64
+libseccomp2:amd64
+libselinux1:amd64
+libsemanage-common
+libsemanage1:amd64
+libsensors4:amd64
+libsepol1:amd64
+libshout3:amd64
+libsigsegv2:amd64
+libslang2:amd64
+libsmartcols1:amd64
+libsndfile1:amd64
+libsnmp-base
+libsnmp30:amd64
+libsodium23:amd64
+libsoup2.4-1:amd64
+libspeex1:amd64
+libspice-server1:amd64
+libsqlite3-0:amd64
+libss2:amd64
+libssl-dev:amd64
+libssl1.0.0:amd64
+libssl1.1:amd64
+libstdc++-7-dev:amd64
+libstdc++6:amd64
+libsystemd0:amd64
+libtag1v5-vanilla:amd64
+libtag1v5:amd64
+libtasn1-6:amd64
+libterm-readkey-perl
+libtext-charwidth-perl
+libtext-iconv-perl
+libtext-wrapi18n-perl
+libthai-data
+libthai0:amd64
+libtheora0:amd64
+libtiff5:amd64
+libtimedate-perl
+libtinfo5:amd64
+libtirpc1:amd64
+libtsan0:amd64
+libtwolame0:amd64
+libubsan0:amd64
+libudev1:amd64
+libunistring2:amd64
+libunwind8:amd64
+liburi-perl
+libusb-1.0-0:amd64
+libusbredirparser1:amd64
+libutempter0:amd64
+libuuid1:amd64
+libuv1:amd64
+libv4l-0:amd64
+libv4lconvert0:amd64
+libvirt-bin
+libvirt-clients
+libvirt-daemon
+libvirt-daemon-driver-storage-rbd
+libvirt-daemon-system
+libvirt-dev:amd64
+libvirt0:amd64
+libvisual-0.4-0:amd64
+libvorbis0a:amd64
+libvorbisenc2:amd64
+libvpx5:amd64
+libwavpack1:amd64
+libwebp6:amd64
+libwind0-heimdal:amd64
+libwrap0:amd64
+libx11-6:amd64
+libx11-data
+libxau6:amd64
+libxcb-render0:amd64
+libxcb-shm0:amd64
+libxcb1:amd64
+libxdamage1:amd64
+libxdmcp6:amd64
+libxen-4.9:amd64
+libxen-dev:amd64
+libxenstore3.0:amd64
+libxext6:amd64
+libxfixes3:amd64
+libxml2-dev:amd64
+libxml2-utils
+libxml2:amd64
+libxmlsec1-openssl:amd64
+libxmlsec1:amd64
+libxmuu1:amd64
+libxpm4:amd64
+libxrender1:amd64
+libxslt1-dev:amd64
+libxslt1.1:amd64
+libxtables12:amd64
+libxv1:amd64
+libyajl2:amd64
+libyaml-0-2:amd64
+libzmq5:amd64
+libzstd1:amd64
+linux-base
+linux-firmware
+linux-generic-hwe-18.04
+linux-headers-4.15.0-55
+linux-headers-4.15.0-55-generic
+linux-headers-4.15.0-99
+linux-headers-4.15.0-99-generic
+linux-headers-5.3.0-51
+linux-headers-5.3.0-51-generic
+linux-headers-generic
+linux-headers-generic-hwe-18.04
+linux-headers-virtual
+linux-image-4.15.0-55-generic
+linux-image-4.15.0-99-generic
+linux-image-5.3.0-51-generic
+linux-image-generic-hwe-18.04
+linux-image-virtual
+linux-libc-dev:amd64
+linux-modules-4.15.0-55-generic
+linux-modules-4.15.0-99-generic
+linux-modules-5.3.0-51-generic
+linux-modules-extra-5.3.0-51-generic
+linux-virtual
+locales
+login
+logrotate
+lsb-base
+lsb-release
+lshw
+lsof
+ltrace
+lvm2
+lxcfs
+lxd
+lxd-client
+make
+man-db
+manpages
+manpages-dev
+mariadb-client-10.1
+mariadb-client-core-10.1
+mariadb-common
+mariadb-server
+mariadb-server-10.1
+mariadb-server-core-10.1
+mawk
+mdadm
+mime-support
+mlocate
+mokutil
+mount
+msr-tools
+mtr-tiny
+multiarch-support
+mysql-common
+nano
+ncurses-base
+ncurses-bin
+ncurses-term
+net-tools
+netbase
+netcat-openbsd
+netplan.io
+networkd-dispatcher
+nfs-common
+nfs-kernel-server
+nginx
+nginx-common
+nginx-core
+nplan
+ntfs-3g
+open-iscsi
+open-vm-tools
+openipmi
+openssh-client
+openssh-server
+openssh-sftp-server
+openssl
+os-prober
+overlayroot
+parted
+passwd
+pastebinit
+patch
+pciutils
+perl
+perl-base
+perl-modules-5.26
+pinentry-curses
+pkg-config
+plymouth
+plymouth-theme-ubuntu-text
+policykit-1
+pollinate
+popularity-contest
+powermgmt-base
+procps
+psmisc
+publicsuffix
+python
+python-apt
+python-apt-common
+python-dev
+python-minimal
+python-pip
+python-pip-whl
+python-pkg-resources
+python-setuptools
+python-virtualenv
+python2.7
+python2.7-dev
+python2.7-minimal
+python3
+python3-apport
+python3-apt
+python3-asn1crypto
+python3-attr
+python3-automat
+python3-blinker
+python3-certifi
+python3-cffi-backend
+python3-chardet
+python3-click
+python3-colorama
+python3-commandnotfound
+python3-configobj
+python3-constantly
+python3-crypto
+python3-cryptography
+python3-dbus
+python3-debconf
+python3-debian
+python3-dev
+python3-distro-info
+python3-distupgrade
+python3-distutils
+python3-gdbm:amd64
+python3-gi
+python3-httplib2
+python3-hyperlink
+python3-idna
+python3-incremental
+python3-jinja2
+python3-json-pointer
+python3-jsonpatch
+python3-jsonschema
+python3-jwt
+python3-keyring
+python3-keyrings.alt
+python3-lib2to3
+python3-markupsafe
+python3-minimal
+python3-mysqldb
+python3-netifaces
+python3-newt:amd64
+python3-oauthlib
+python3-openssl
+python3-pam
+python3-pip
+python3-pkg-resources
+python3-problem-report
+python3-pyasn1
+python3-pyasn1-modules
+python3-pymysql
+python3-requests
+python3-requests-unixsocket
+python3-secretstorage
+python3-serial
+python3-service-identity
+python3-setuptools
+python3-six
+python3-software-properties
+python3-systemd
+python3-twisted
+python3-twisted-bin:amd64
+python3-update-manager
+python3-urllib3
+python3-venv
+python3-virtualenv
+python3-wheel
+python3-xdg
+python3-yaml
+python3-zmq
+python3-zope.interface
+python3.6
+python3.6-dev
+python3.6-minimal
+python3.6-venv
+qemu-block-extra:amd64
+qemu-kvm
+qemu-system-common
+qemu-system-x86
+qemu-utils
+readline-common
+rpcbind
+rsync
+rsyslog
+run-one
+sbsigntool
+screen
+seabios
+secureboot-db
+sed
+sensible-utils
+sgabios
+shared-mime-info
+sharutils
+shim
+shim-signed
+snapd
+socat
+software-properties-common
+sosreport
+squashfs-tools
+ssh-import-id
+strace
+sudo
+systemd
+systemd-sysv
+sysvinit-utils
+tar
+tcpdump
+telnet
+tftp-hpa
+tftpd-hpa
+time
+tmux
+tzdata
+ubuntu-advantage-tools
+ubuntu-keyring
+ubuntu-minimal
+ubuntu-release-upgrader-core
+ubuntu-server
+ubuntu-standard
+ucf
+udev
+ufw
+uidmap
+unattended-upgrades
+update-inetd
+update-manager-core
+update-notifier-common
+ureadahead
+usbutils
+util-linux
+uuid-runtime
+vim
+vim-common
+vim-runtime
+vim-tiny
+virtualenv
+wget
+whiptail
+wireless-regdb
+xauth
+xdelta3
+xdg-user-dirs
+xfsprogs
+xinetd
+xkb-data
+xxd
+xz-utils
+zerofree
+zlib1g-dev:amd64
+zlib1g:amd64
+# NOTE (fdegir): pinned docker versions
+docker-ce={{ docker_ce_version }}
+docker-ce-cli={{ docker_ce_cli_version }}
+containerd.io={{ containerd_io_version }}
diff --git a/playbooks/roles/package/vars/Debian.yaml b/playbooks/roles/package/vars/Debian.yaml
new file mode 100644
index 0000000..2a0f35f
--- /dev/null
+++ b/playbooks/roles/package/vars/Debian.yaml
@@ -0,0 +1,33 @@
+---
+# ============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=========================================================
+
+# package names
+packages:
+ - dpkg-dev
+ - docker-ce={{ docker_ce_version }}
+ - docker-ce-cli={{ docker_ce_cli_version }}
+ - containerd.io={{ containerd_io_version }}
+
+# service names
+docker_service_name: docker
+
+os_distro: "ubuntu"
+os_kolla_install_type: "source"
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/postinstall/tasks/main.yml b/playbooks/roles/postinstall/tasks/main.yml
new file mode 100644
index 0000000..cad4966
--- /dev/null
+++ b/playbooks/roles/postinstall/tasks/main.yml
@@ -0,0 +1,44 @@
+---
+# ============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: Copy openstack admin-openrc.sh to /home/{{ ansible_env.SUDO_USER }}
+ copy:
+ src: "{{ engine_cache }}/config/admin-openrc.sh"
+ dest: "{{ ansible_env.HOME }}/admin-openrc.sh"
+ mode: 0644
+
+- name: Create external network {{ external_network }}
+ os_network:
+ state: present
+ name: "{{ external_network }}"
+ external: true
+ provider_network_type: "flat"
+ provider_physical_network: "physnet1"
+
+- name: Create external subnet {{ external_subnet }}
+ os_subnet:
+ state: present
+ enable_dhcp: false
+ network_name: "{{ external_network }}"
+ name: "{{ external_subnet }}"
+ cidr: "{{ idf.net_config.neutron.network }}/{{ idf.net_config.neutron.mask }}"
+ gateway_ip: "{{ idf.net_config.neutron.network | regex_replace('.0$', '.1') }}"
+ allocation_pool_start: "{{ idf.net_config.neutron.network | regex_replace('.0$', '.51') }}"
+ allocation_pool_end: "{{ idf.net_config.neutron.network | regex_replace('.0$', '.250') }}"
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/postinstall/vars/main.yml b/playbooks/roles/postinstall/vars/main.yml
new file mode 100644
index 0000000..ddf55ae
--- /dev/null
+++ b/playbooks/roles/postinstall/vars/main.yml
@@ -0,0 +1,22 @@
+---
+# ============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=========================================================
+external_network: "ext-net"
+external_subnet: "ext-subnet"
+
+# vim: set ts=2 sw=2 expandtab:
diff --git a/playbooks/roles/prepare-artifacts/tasks/main.yaml b/playbooks/roles/prepare-artifacts/tasks/main.yaml
new file mode 100644
index 0000000..b42f8da
--- /dev/null
+++ b/playbooks/roles/prepare-artifacts/tasks/main.yaml
@@ -0,0 +1,57 @@
+---
+# ============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: Get list of kolla container image tarfiles
+ find:
+ path: "{{ engine_workspace }}/offline/containers"
+ patterns: '*.tar'
+ register: container_image
+
+# NOTE (fdegir): the user may not be member of docker group so we need root
+# TODO (fdegir): we can perhaps skip loading already existing images here
+- name: Load kolla container images from tarfiles
+ shell: docker load < {{ item.path }}
+ loop: "{{ container_image.files }}"
+ changed_when: false
+ become: true
+
+# NOTE (fdegir): the escape of curly brackets in ansible is really messy unfortunately
+# we also shouldn't attempt to tag and push container images that are already on local registry
+# NOTE (fdegir): we do not push any image that is already on engine.local and any image without tag
+- name: Get list of loaded kolla container images to push
+ shell: |
+ set -o pipefail
+ docker images --format '{{ '{{' }}.Repository{{ '}}' }}':'{{ '{{' }}.Tag{{ '}}' }}' | grep -v '{{ server_fqdn }}\|<none>' | sort
+ args:
+ executable: /bin/bash
+ changed_when: false
+ become: true
+ register: container_images
+
+# TODO (fdegir): it is messy to use ansible module for tagging and pushing but we can still look into it
+# TODO (fdegir): we can perhaps skip tagging & pushing already existing images here
+- name: Tag and push kolla container images to local registry
+ shell: |
+ docker tag {{ item }} {{ server_fqdn }}/{{ item }}
+ docker push {{ server_fqdn }}/{{ item }}
+ loop: "{{ container_images.stdout_lines }}"
+ changed_when: false
+ become: true
+
+# vim: set ts=2 sw=2 expandtab: