summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Silvius <s.silvius@partner.samsung.com>2019-02-10 13:24:03 +0200
committerSamuli Silvius <s.silvius@partner.samsung.com>2019-02-13 09:13:42 +0200
commitf3eee9e2131a59e2a0995c53c07001f24f9187a2 (patch)
tree731e835b08e351ec10e701172eede4c0bd976a6b
parent426e6c09fe0c8a0d0c35631231f023eaf8823775 (diff)
More default values and simplify onap config
Populate more default values for ansible all.yml configuration to make it simpler by default for user. Removed project_configuration variable as it caused just confusion. Replaced that mostly by using app_name variable. According to above changed simplified actual configuration config/application_configuration.yml used to install onap. Mostly removed repeation of comments. Also updated ansible/application/README.md that was not updated for a while. Issue-ID: OOM-1633 Change-Id: Idcc4c510b64bb61edd874d0e0616cdb41938f2d3 Signed-off-by: Samuli Silvius <s.silvius@partner.samsung.com>
-rw-r--r--ansible/application/README.md29
-rwxr-xr-xansible/group_vars/all.yml20
-rw-r--r--build/package.conf10
-rwxr-xr-xconfig/application_configuration.yml94
-rwxr-xr-xdoc/BuildGuide.rst16
5 files changed, 47 insertions, 122 deletions
diff --git a/ansible/application/README.md b/ansible/application/README.md
index 342240be..d260b3cb 100644
--- a/ansible/application/README.md
+++ b/ansible/application/README.md
@@ -1,8 +1,8 @@
# Application specific configuration
This directory is **empty** on purpose in git. Content in this folder is
-placed on installer packaging time and can be modified by user on target
-server where installer package is installed.
+populated packaging time (see package.sh/package.conf) and can be modified if needed
+also on target server where package is installed.
## Application configuration
@@ -20,34 +20,20 @@ Example:
Application helm charts must be available on infra node before application playbook is executed.
That folder on infra node is specified within `app_helm_charts_infra_directory` variable.
-Helm charts folder name is configured on `application_configuration.yml` file
-with `app_helm_charts_directory` variable - it is the path on remote infrastructure server.
-
-Example:
-```
-app_helm_charts_directory: /opt/application/helm_charts
-```
-
-It is expected that helm charts are available from packaging script as a part of installer SW package.
-Such source directory of helm charts is specified by `app_helm_charts_install_directory` variable
-
-Example:
-```
-app_helm_charts_install_directory: ansible/application/helm_charts/kubernetes
-```
+There is a good default value for this variable and if not changed, installer will handle
+Helm charts transfer from packaging up to the target infra server.
## Application specific roles
Installer supports optional custom pre and post install roles. Custom roles' code folders
-need to be placed to this directory and name of those folders are configured in
+are placed to this directory at packaging time and name of those folders are configured in
application.yml with variable `application_pre_install_role` and `application_post_install_role`.
Example:
```
-application_pre_install_role: "{{ project_configuration }}-patch-role"
+application_pre_install_role: "{{ app_name }}-patch-role"
```
-
## Inventory hosts
Ansible inventory file is least application specific but in practice example
@@ -56,3 +42,6 @@ and at least ip addresses need to be changed according to target servers after
installer installation and before starting installer execution.
So it's better to place also hosts.yml to this application directory and edit it here.
+That can be done either at packaging time same way as application_configuration.yml
+or after package has been installed to server where ansible process are run just
+before lauching any playbooks.
diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index dbb05205..cd8c7f58 100755
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -65,7 +65,7 @@ deploy_rpm_repository: yes
# Offline solution is deploying app specific rpm repository and requires some name
# also for k8s cluster
-# e.g. app_name: ONAP
+# e.g. app_name: onap
app_name:
# runtime_images provides an way to insert docker images
@@ -90,12 +90,6 @@ runtime_images:
# Application specific params #
###############################
-# Project name to utilize same codebase. Just helper variable inside ansible
-# configuration files (like this file) to avoid writing own project name multiple
-# times for paths, namespaces, Helm release, derived variables..
-# e.g. project_configuration: onap-casablanca
-project_configuration:
-
# App Helm charts directory location in installation package.
# The path is absolute path (even locates relative inside of this sw package
# installation folder) because it must be visible for ansible docker/chroot
@@ -116,7 +110,7 @@ app_helm_charts_infra_directory: "{{ app_data_path }}/helm_charts"
# Main Helm chart to install
# e.g. app_helm_chart_name: onap
-app_helm_chart_name:
+app_helm_chart_name: "{{ app_name }}"
# Targets for helm charts repository build
# e.g. for ONAP Casablanca
@@ -128,19 +122,19 @@ app_helm_build_targets:
# Directory with helm plugins
# It's an optional parameter used e.g. in OOM Casablanca
# app_helm_plugins_directory: "{{ app_helm_charts_install_directory}}/helm/plugins/"
-app_helm_plugins_directory:
+app_helm_plugins_directory: "{{ app_helm_charts_install_directory}}/helm/plugins/"
# Helm release name (visible in POD names) used by Helm
-# e.g. app_helm_release_name: "{{ project_configuration }}"
-app_helm_release_name: "{{ project_configuration }}"
+# e.g. app_helm_release_name: onap
+app_helm_release_name: "{{ app_name }}"
# Kubernetes namespace where application is installed
# e.g. app_kubernetes_namespace: onap
-app_kubernetes_namespace:
+app_kubernetes_namespace: "{{ app_name }}"
# Optional application custom Ansible roles name for pre and post install logic.
# Location of additional custom roles is defined in ansible.cfg with roles_path.
-# e.g. application_pre_install_role: "{{ project_configuration }}-patch-role"
+# e.g. application_pre_install_role: "{{ app_name }}-patch-role"
application_pre_install_role:
application_post_install_role:
diff --git a/build/package.conf b/build/package.conf
index 78da5eac..29ca3cb1 100644
--- a/build/package.conf
+++ b/build/package.conf
@@ -21,7 +21,8 @@
# E.g. in case of ONAP oom repo it will be the content of kubernetes directory.
# NOTE: Leaving this variable commented out will mean that no Helm application will be installed to
# offline Kubernetes cluster. This may be sometimes wanted.
-#HELM_CHARTS_DIR=~/myclones/casablanca_oom/
+#HELM_CHARTS_DIR=<oom-clone>/kubernetes
+HELM_CHARTS_DIR=/tmp/oom-clone/kubernetes
#####################################
# Application install configuration #
@@ -51,6 +52,10 @@
# <offline-installer-clone>/patches/onap-casablanca-patch-role
# ~/myappfiles/my-post-install-role
#)
+APP_CONFIGURATION=(
+ /tmp/offline-installer/config/application_configuration.yml
+ /tmp/offline-installer/patches/onap-casablanca-patch-role
+)
# APP_BINARY_RESOURCES_DIR is variable to directory containing directories and files for offline
# installer infra and the the application run in that infra.
@@ -63,6 +68,7 @@
# pkg ... directory with rpm/deb packages mainly for offline infra
# nexus_data.tar ... tar file with pre-generated nexus blobs containing e.g. docker images for the application.
#APP_BINARY_RESOURCES_DIR=~/myappfiles/all_binaries
+APP_BINARY_RESOURCES_DIR=/tmp/onap-offline/resources
# APP_AUX_BINARIES is array variable for additional application files.
# Docker images supported currently in tar format.
@@ -70,3 +76,5 @@
# ~/myappfiles/docker_images_populated_runtime/aaa-component-0.0.1.tar
# ~/myappfiles/docker_images_populated_runtime/xyz-component-0.0.1.tar
#)
+APP_AUX_BINARIES=()
+
diff --git a/config/application_configuration.yml b/config/application_configuration.yml
index e5438dce..25737edb 100755
--- a/config/application_configuration.yml
+++ b/config/application_configuration.yml
@@ -1,95 +1,21 @@
---
-###################################
-# Resources configuration entries #
-###################################
-# Resource host information
-
-# folder on resource host where tars with resources are present
+#
+# This is example configuration to install offline ONAP.
+# See available variables to configure and used default values
+# from ../ansible/group_vars/*.yml files.
+#
resources_dir: /data
-
-# tarfile name within this folder with offline infrastructure sw
-resources_filename: onap-offline-onap-full-3.0.0.resources.tar
-
-# Infra node specific information
-
-# offline solution source data binaries will be decompressed in following dir on infra
-# e.g. app_data_path: /opt/onap
-app_data_path: /opt/onap
-
-##########################################
-# Offline Infrastructure specific params #
-##########################################
-
-# information from which rootCA is created
-# e.g.
-# organization_name: Samsung
-# state_or_province_name: Poland
-# country_name: PL
-# locality_name: Krakow
+app_name: onap
+resources_filename: "offline-{{ app_name }}-3.0.0.resources.tar"
+app_data_path: "/opt/{{ app_name }}"
certificates:
organization_name: Samsung
state_or_province_name: Poland
country_name: PL
locality_name: Krakow
-
-# Offline solution is deploying app specific rpm repository and requires some name
-# also for k8s cluster
-# e.g. app_name: ONAP
-app_name: ONAP
-
-
-###############################
-# Application specific params #
-###############################
-
-# Project name to utilize same codebase
-# e.g. project_configuration: onap-full
-project_configuration: onap-full
-
-# App Helm charts dir. E.g. application/helm_charts/<xxx> where xxx is a charts folder name.
-# Helm charts are expected to be inside SW package somewhere inside ./ansible/application
-# those will be available for offline installer under /ansible/application/<helm_charts_name>
-# for OOM project helm charts are usually within kubernetes sub-folder
-# so the path for them can be:
-# e.g app_helm_charts_install_directory: "/ansible/application/oom/kubernetes"
-app_helm_charts_install_directory: "/ansible/application/helm_charts"
-
-# to specify target dir where helm charts should be copied into on infra node
-# this should be directory with all charts and Makefile
-# e.g. app_helm_charts_infra_directory: "{{ app_data_path }}/helm_charts"
-app_helm_charts_infra_directory: "{{ app_data_path }}/helm_charts"
-
-# Main Helm chart to install
-# e.g. app_helm_chart_name: onap
-app_helm_chart_name: onap
-
-# Targets for helm charts repository build
-# e.g. for ONAP Casablanca
-# app_helm_build_targets:
-# - all
-# - onap
app_helm_build_targets:
- all
- - onap
-
-# Directory with helm plugins
-# It's an optional parameter used e.g. in OOM Casablanca
-# app_helm_plugins_directory: "{{ app_helm_charts_install_directory}}/kubernetes/helm/plugins/"
-app_helm_plugins_directory: "{{ app_helm_charts_install_directory}}/kubernetes/helm/plugins/"
-
-# Helm release name (visible in POD names) used by Helm
-# e.g. app_helm_release_name: "{{ project_configuration }}"
-app_helm_release_name: "{{ project_configuration }}"
-
-# Kubernetes namespace where application is installed
-# e.g. app_kubernetes_namespace: onap
-app_kubernetes_namespace: onap
-
-# Optional application custom Ansible roles name for pre and post install logic.
-# Location of additional custom roles is defined in ansible.cfg with roles_path.
-# e.g. application_pre_install_role: "{{ project_configuration }}-patch-role"
-application_pre_install_role: onap-casablanca-patch-role
-application_post_install_role:
+ - "{{ app_name }}"
+application_pre_install_role: "{{ app_name }}-casablanca-patch-role"
-# any other application specific params can be specified in this file
diff --git a/doc/BuildGuide.rst b/doc/BuildGuide.rst
index a06180e0..c9148f12 100755
--- a/doc/BuildGuide.rst
+++ b/doc/BuildGuide.rst
@@ -296,26 +296,34 @@ offline. Use the following command:
For example:
-``$ ./build/fetch_and_patch_charts.sh https://gerrit.onap.org/r/oom 3.0.0-ONAP /root/offline-installer/patches/casablanca_3.0.0.patch /tmp/offline-installer/ansible/application/helm_charts``
+``$ ./build/fetch_and_patch_charts.sh https://gerrit.onap.org/r/oom 3.0.0-ONAP /tmp/offline-installer/patches/casablanca_3.0.0.patch /tmp/oom-clone``
Part 5. Creating offline installation package
---------------------------------------------
For the packagin itself it's necessary to prepare configuration. You can
-use ./onap/install/onap-offline/build/package.conf as template or
+use ./build/package.conf as template or
directly modify it.
There are some parameters needs to be set in configuration file.
+Example values below are setup according to steps done in this guide to package ONAP.
+---------------------------------------+------------------------------------------------------------------------------+
| Parameter | Description |
+=======================================+==============================================================================+
| HELM\_CHARTS\_DIR | directory with Helm charts for the application |
+| | Example: /tmp/oom-clone/kubernetes |
+---------------------------------------+------------------------------------------------------------------------------+
| APP\_CONFIGURATION | application install configuration (application_configuration.yml) for |
-| | ansible installer and custom ansible role code directories if any |
+| | ansible installer and custom ansible role code directories if any. |
+| | Example: |
+| | APP_CONFIGURATION=( |
+| | /tmp/offline-installer/config/application_configuration.yml |
+| | /tmp/offline-installer/patches/onap-casablanca-patch-role |
+| | ) |
+---------------------------------------+------------------------------------------------------------------------------+
| APP\_BINARY\_RESOURCES\_DIR | directory with all (binary) resources for offline infra and application |
+| | Example: /tmp/onap-offline/resources |
+---------------------------------------+------------------------------------------------------------------------------+
| APP\_AUX\_BINARIES | additional binaries such as docker images loaded during runtime [optional] |
+---------------------------------------+------------------------------------------------------------------------------+
@@ -327,7 +335,7 @@ following command run from offline-installer directory
E.g.
-``$ ./build/package.sh onap 1.0.1 /tmp/package_onap_1.0.0"``
+``$ ./build/package.sh onap 1.0.1 /tmp/package"``
So in the target directory you should find tar files with