From 09cee3636fee20ba551e211c60f6e9942079cfb9 Mon Sep 17 00:00:00 2001 From: Fatih Degirmenci Date: Sun, 24 Jun 2018 01:04:10 +0200 Subject: Integrate os-nosdn-osm scenario This change integrates os-nosdn-osm scenario. The installation of OSM is done as post-deployment. This is achieved by the addition of the new playbook named post-deployment.yml in scenario role folder. This mechanism is available for all OpenStack scenarios. If anything needs to be done for a specific scenario as part of the post-deployment, it can be achieved by creating playbook post-deployment.yml. If post-deployment.yml exists in scenario role, the framework will run it once the regular deployment playbooks are run successfully. If the file does not exist, it will be skipped. The location of the post-deployment.yml is releng-xci-scenarios//role//tasks/post-deployment.yml This is only implemented for OpenStack scenarios currently and similar mechanism is needed for K8S scenarios as well which will be implemented in a separate change. installer-type:osa deploy-scenario:os-nosdn-osm Change-Id: I16780abffca39699eb2f38f662479f0e4d551504 Signed-off-by: Fatih Degirmenci --- xci/installer/osa/deploy.sh | 16 +++++- xci/installer/osa/playbooks/post-deployment.yml | 65 +++++++++++++++++++++++++ 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 xci/installer/osa/playbooks/post-deployment.yml (limited to 'xci/installer/osa') diff --git a/xci/installer/osa/deploy.sh b/xci/installer/osa/deploy.sh index 4542a4e3..fd794d01 100755 --- a/xci/installer/osa/deploy.sh +++ b/xci/installer/osa/deploy.sh @@ -68,7 +68,6 @@ echo "Info: Configured opnfv deployment host for openstack-ansible" #------------------------------------------------------------------------------- # This playbook is only run for the all flavors except aio since aio is configured # by an upstream script. - # This playbook # - adds public keys to target hosts # - configures network @@ -181,4 +180,19 @@ echo "Info: Admin username - ${USERNAME##*=}" echo "Info: Admin password - ${PASSWORD##*=}" echo "Info: It is recommended to change the default password." +#------------------------------------------------------------------------------- +# Execute post-installation tasks +#------------------------------------------------------------------------------- +# Playbook post.yml is used in order to execute any post-deployment tasks that +# are required for the scenario under test. +#------------------------------------------------------------------------------- +echo "-----------------------------------------------------------------------" +echo "Info: Running post-deployment scenario role" +echo "-----------------------------------------------------------------------" +cd $OSA_XCI_PLAYBOOKS +ansible-playbook ${XCI_ANSIBLE_PARAMS} -i ${XCI_PLAYBOOKS}/dynamic_inventory.py \ + post-deployment.yml +echo "-----------------------------------------------------------------------" +echo +echo "Info: Post-deployment scenario role execution done" # vim: set ts=4 sw=4 expandtab: diff --git a/xci/installer/osa/playbooks/post-deployment.yml b/xci/installer/osa/playbooks/post-deployment.yml new file mode 100644 index 00000000..c0cd0171 --- /dev/null +++ b/xci/installer/osa/playbooks/post-deployment.yml @@ -0,0 +1,65 @@ +--- +# SPDX-license-identifier: Apache-2.0 +############################################################################## +# Copyright (c) 2018 Ericsson AB and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +- hosts: opnfv + remote_user: root + vars_files: + - "{{ xci_path }}/xci/var/opnfv.yml" + - "{{ xci_path }}/xci/installer/osa/files/openstack_services.yml" + + environment: + http_proxy: "{{ lookup('env','http_proxy') }}" + https_proxy: "{{ lookup('env','https_proxy') }}" + no_proxy: "{{ lookup('env','no_proxy') }}" + HTTP_PROXY: "{{ lookup('env','http_proxy') }}" + HTTPS_PROXY: "{{ lookup('env','https_proxy') }}" + NO_PROXY: "{{ lookup('env','no_proxy') }}" + pre_tasks: + - name: Load distribution variables + include_vars: + file: "{{ item }}" + with_items: + - "{{ xci_path }}/xci/var/{{ ansible_os_family }}.yml" + - name: Set facts for remote deployment + set_fact: + remote_xci_scenario_path: "{{ ansible_env.HOME }}/releng-xci/.cache/repos/scenarios/{{ deploy_scenario }}/scenarios/{{ deploy_scenario }}" + + roles: + - role: peru.proxy_settings + proxy_settings_http_proxy: "{{ lookup('env','http_proxy') }}" + proxy_settings_https_proxy: "{{ lookup('env','https_proxy') }}" + proxy_settings_ftp_proxy: "{{ lookup('env','ftp_proxy') }}" + proxy_settings_no_proxy: "{{ lookup('env','no_proxy') }}" + + tasks: + - name: "Configure http_proxy_env_url" + lineinfile: + path: "{{openstack_osa_etc_path}}/user_variables_proxy.yml" + regexp: "^http_proxy_env_url:.*" + line: "{{ 'http_proxy_env_url: ' + lookup('env','http_proxy') }}" + when: + - lookup('env','http_proxy') != "" + + - name: Reload XCI deployment host facts + setup: + filter: ansible_local + gather_subset: "!all" + delegate_to: 127.0.0.1 + + - name: Check if any post-deployment task defined for {{ deploy_scenario }} role + stat: + path: "{{ remote_xci_scenario_path }}/role/{{ deploy_scenario }}/tasks/post-deployment.yml" + register: post_deployment_yml + + - name: Execute post-deployment tasks of {{ deploy_scenario }} role + include_role: + name: "{{ hostvars['opnfv'].ansible_local.xci.scenarios.role }}" + tasks_from: post-deployment + when: + - post_deployment_yml.stat.exists -- cgit 1.2.3-korg