From 1366a908bf10d74bc0fb5be3a7899f23363e4fdb Mon Sep 17 00:00:00 2001 From: Sanket Date: Tue, 13 Nov 2018 14:09:21 -0500 Subject: [PATCH 01/10] Remove tim filech checks --- .../common/tasks/check-predeploy-prereq.yml | 6 ------ src/roles/common/tasks/vsc-process-vars.yml | 18 ------------------ src/roles/vsc-upgrade-deploy/tasks/main.yml | 17 +++++++++++++++++ 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/src/roles/common/tasks/check-predeploy-prereq.yml b/src/roles/common/tasks/check-predeploy-prereq.yml index de81eb405c..2c8dbb673c 100644 --- a/src/roles/common/tasks/check-predeploy-prereq.yml +++ b/src/roles/common/tasks/check-predeploy-prereq.yml @@ -25,12 +25,6 @@ when: component_type | default("NONE") != 'vrs' -- name: Check that TIM file was found - assert: - that: "vsc_tim_path is defined and vsc_tim_file_name is defined" - msg: "Missing VSC TIM image file for {{ hostname }} under the unzipped file directory, please unzip it and issue reset_build" - when: component_type | default("NONE") == 'vsc' - - block: - name: Check that VRS package files were found diff --git a/src/roles/common/tasks/vsc-process-vars.yml b/src/roles/common/tasks/vsc-process-vars.yml index a6b3826ccb..4b853feb46 100644 --- a/src/roles/common/tasks/vsc-process-vars.yml +++ b/src/roles/common/tasks/vsc-process-vars.yml @@ -38,24 +38,6 @@ tags: - vsc -- block: - - - name: Find name of VSC TIM File - find: path="{{ nuage_unzipped_files_dir }}/vsc/single_disk" pattern="cpm.tim" recurse=yes - register: rc_vsc_tim_file - - - debug: var=rc_vsc_tim_file verbosity=1 - - - name: Register VSC TIM variables with proper path and image locations for use in other playbooks - set_fact: - vsc_tim_path: "{{ rc_vsc_tim_file.files[0].path | dirname }}" - vsc_tim_file_name: "{{ rc_vsc_tim_file.files[0].path | basename }}" - when: rc_vsc_tim_file.matched > 0 - - when: - - vscs is defined - tags: - - vsc - name: Set vscs_check set_fact: vscs_check={{vscs is defined}} diff --git a/src/roles/vsc-upgrade-deploy/tasks/main.yml b/src/roles/vsc-upgrade-deploy/tasks/main.yml index 04447cc1ef..a0506242ac 100644 --- a/src/roles/vsc-upgrade-deploy/tasks/main.yml +++ b/src/roles/vsc-upgrade-deploy/tasks/main.yml @@ -42,6 +42,23 @@ - name: Print image version in json when verbosity >= 1 debug: var=version_json verbosity=1 +- name: Find name of VSC TIM File + find: path="{{ nuage_unzipped_files_dir }}/vsc/single_disk" pattern="cpm.tim" recurse=yes + register: rc_vsc_tim_file + delegate_to: localhost + +- name: Register VSC TIM variables with proper path and image locations for use in other playbooks + set_fact: + vsc_tim_path: "{{ rc_vsc_tim_file.files[0].path | dirname }}" + vsc_tim_file_name: "{{ rc_vsc_tim_file.files[0].path | basename }}" + when: rc_vsc_tim_file.matched > 0 + +- name: Check that TIM file was found + assert: + that: "vsc_tim_path is defined and vsc_tim_file_name is defined" + msg: "Missing VSC TIM image file for {{ hostname }} under the unzipped file directory, please unzip it and issue reset_build" + when: component_type | default("NONE") == 'vsc' + - name: Copy new VSC image to VSC nodes expect: command: "{{ vsc_image_copy }}" From e954d2f54ea318b58357a65bb3c46f2c6e6fef79 Mon Sep 17 00:00:00 2001 From: Sanket Date: Wed, 14 Nov 2018 16:55:52 -0500 Subject: [PATCH 02/10] Changes to VSC tim based on target server --- src/roles/vsc-upgrade-deploy/tasks/main.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/roles/vsc-upgrade-deploy/tasks/main.yml b/src/roles/vsc-upgrade-deploy/tasks/main.yml index a0506242ac..c91ad155c5 100644 --- a/src/roles/vsc-upgrade-deploy/tasks/main.yml +++ b/src/roles/vsc-upgrade-deploy/tasks/main.yml @@ -43,9 +43,16 @@ debug: var=version_json verbosity=1 - name: Find name of VSC TIM File - find: path="{{ nuage_unzipped_files_dir }}/vsc/single_disk" pattern="cpm.tim" recurse=yes + find: path="{{ qcow2_path }}" pattern="cpm.tim" recurse=yes register: rc_vsc_tim_file delegate_to: localhost + when: target_server_type | match("kvm") + +- name: Find name of VSC TIM File + find: path="{{ ova_path }}" pattern="cpm.tim" recurse=yes + register: rc_vsc_tim_file + delegate_to: localhost + when: target_server_type | match("vcenter") - name: Register VSC TIM variables with proper path and image locations for use in other playbooks set_fact: @@ -57,7 +64,6 @@ assert: that: "vsc_tim_path is defined and vsc_tim_file_name is defined" msg: "Missing VSC TIM image file for {{ hostname }} under the unzipped file directory, please unzip it and issue reset_build" - when: component_type | default("NONE") == 'vsc' - name: Copy new VSC image to VSC nodes expect: From 416a40553e59367525813779a20a75f106827240 Mon Sep 17 00:00:00 2001 From: brcastel Date: Wed, 14 Nov 2018 19:32:07 -0800 Subject: [PATCH 03/10] update license and version numbers --- Documentation/RELEASE_NOTES.md | 5 +++++ LICENSE.md | 13 +++++++++++++ README.md | 4 ++-- metroae | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 LICENSE.md diff --git a/Documentation/RELEASE_NOTES.md b/Documentation/RELEASE_NOTES.md index 047d61a391..3f42336a3a 100644 --- a/Documentation/RELEASE_NOTES.md +++ b/Documentation/RELEASE_NOTES.md @@ -1,5 +1,10 @@ # Metro Automation Engine Release Notes +## Release 3.0.1 + +### Resolved Issues +* Fix build_vars.yml conversion script + ## Release 3.0.0 ### New Features and Enhancements diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000000..0c6c00e3d2 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,13 @@ +Copyright 2016 Nuage Networks + +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. diff --git a/README.md b/README.md index abafabd73e..8bf323195b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Nuage Networks Metro Automation Engine (MetroÆ) (4 minute read) -Version: 3.0.0 +Version: 3.0.1 MetroÆ is an automation engine that deploys and upgrades Nuage Networks components. You specify the individual details of your target platform, then let MetroÆ install, upgrade, destroy, or health-check the environment for you. @@ -134,4 +134,4 @@ Report bugs you find and suggest new features and enhancements via the [GitHub I You may also [contribute](CONTRIBUTING.md) to MetroÆ by submitting your own code to the project. ## License -Apache License 2.0 +[LICENSE.md](LICENSE.md) diff --git a/metroae b/metroae index 03dd668f9e..301caf67e0 100755 --- a/metroae +++ b/metroae @@ -4,7 +4,7 @@ set -e # Wrapper around ansible-playbook for the installation of Nuage components # -METROAE_VERSION="v3.0.0" +METROAE_VERSION="v3.0.1" CURRENT_DIR=`pwd` PLAYBOOK_DIR=$CURRENT_DIR/src/playbooks From 467c3d0de3d8dbe6805ad571b540c991c2ba22b6 Mon Sep 17 00:00:00 2001 From: Mike Piecuch Date: Thu, 15 Nov 2018 09:36:38 -0500 Subject: [PATCH 04/10] Fix additional issues with build_vars conversion --- convert_build_vars_to_deployment.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/convert_build_vars_to_deployment.py b/convert_build_vars_to_deployment.py index c26bb5cdc6..bfda70e13d 100755 --- a/convert_build_vars_to_deployment.py +++ b/convert_build_vars_to_deployment.py @@ -28,11 +28,26 @@ def read_build_vars(build_vars_file): substitutions = yaml.safe_load(build_var_contents) - build_vars_template = jinja2.Template(build_var_contents, - autoescape=False, - undefined=jinja2.StrictUndefined) + try: + build_vars_template = jinja2.Template(build_var_contents, + autoescape=False, + undefined=jinja2.StrictUndefined) - resolved_yaml = build_vars_template.render(substitutions) + resolved_yaml = build_vars_template.render(substitutions) + + substitutions = yaml.safe_load(resolved_yaml) + + # Do template resolution a second time to resolve nested substitution + build_vars_template = jinja2.Template(resolved_yaml, + autoescape=False, + undefined=jinja2.StrictUndefined) + + resolved_yaml = build_vars_template.render(substitutions) + except jinja2.exceptions.UndefinedError as e: + print str(e) + print ("The above variable is missing from build_vars, please define " + "it in the build_vars file.") + exit(1) var_dict = yaml.safe_load(resolved_yaml) From 485e95897f5d8e19063a1016a4b463aceac3b270 Mon Sep 17 00:00:00 2001 From: Sanket Date: Thu, 15 Nov 2018 11:06:24 -0500 Subject: [PATCH 05/10] More changes --- .../common/tasks/check-upgrade-prereq.yml | 6 +++++ src/roles/common/tasks/vsc-process-vars.yml | 18 +++++++++++++++ src/roles/vsc-upgrade-deploy/tasks/main.yml | 23 ------------------- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/src/roles/common/tasks/check-upgrade-prereq.yml b/src/roles/common/tasks/check-upgrade-prereq.yml index 3ac737bf03..aa11215333 100644 --- a/src/roles/common/tasks/check-upgrade-prereq.yml +++ b/src/roles/common/tasks/check-upgrade-prereq.yml @@ -37,3 +37,9 @@ msg: "vstat_upgrade_scripts_file is missing" when: component_type | default("NONE") == 'vstat' + + - name: Check that TIM file was found for VSC + assert: + that: "vsc_tim_path is defined and vsc_tim_file_name is defined" + msg: "Missing VSC TIM image file for {{ hostname }} under the unzipped file directory, please unzip it and issue reset_build" + when: component_type | default("NONE") == 'vsc' diff --git a/src/roles/common/tasks/vsc-process-vars.yml b/src/roles/common/tasks/vsc-process-vars.yml index 4b853feb46..4ee2d9ccd7 100644 --- a/src/roles/common/tasks/vsc-process-vars.yml +++ b/src/roles/common/tasks/vsc-process-vars.yml @@ -38,6 +38,24 @@ tags: - vsc + - block: + + - name: Find name of VSC TIM File + find: path="{{ nuage_unzipped_files_dir }}/vsc/single_disk" pattern="cpm.tim" recurse=yes + register: rc_vsc_tim_file + + - debug: var=rc_vsc_tim_file verbosity=1 + + - name: Register VSC TIM variables with proper path and image locations for use in other playbooks + set_fact: + vsc_tim_path: "{{ rc_vsc_tim_file.files[0].path | dirname }}" + vsc_tim_file_name: "{{ rc_vsc_tim_file.files[0].path | basename }}" + when: rc_vsc_tim_file.matched > 0 + + when: + - vscs is defined + tags: + - vsc - name: Set vscs_check set_fact: vscs_check={{vscs is defined}} diff --git a/src/roles/vsc-upgrade-deploy/tasks/main.yml b/src/roles/vsc-upgrade-deploy/tasks/main.yml index c91ad155c5..04447cc1ef 100644 --- a/src/roles/vsc-upgrade-deploy/tasks/main.yml +++ b/src/roles/vsc-upgrade-deploy/tasks/main.yml @@ -42,29 +42,6 @@ - name: Print image version in json when verbosity >= 1 debug: var=version_json verbosity=1 -- name: Find name of VSC TIM File - find: path="{{ qcow2_path }}" pattern="cpm.tim" recurse=yes - register: rc_vsc_tim_file - delegate_to: localhost - when: target_server_type | match("kvm") - -- name: Find name of VSC TIM File - find: path="{{ ova_path }}" pattern="cpm.tim" recurse=yes - register: rc_vsc_tim_file - delegate_to: localhost - when: target_server_type | match("vcenter") - -- name: Register VSC TIM variables with proper path and image locations for use in other playbooks - set_fact: - vsc_tim_path: "{{ rc_vsc_tim_file.files[0].path | dirname }}" - vsc_tim_file_name: "{{ rc_vsc_tim_file.files[0].path | basename }}" - when: rc_vsc_tim_file.matched > 0 - -- name: Check that TIM file was found - assert: - that: "vsc_tim_path is defined and vsc_tim_file_name is defined" - msg: "Missing VSC TIM image file for {{ hostname }} under the unzipped file directory, please unzip it and issue reset_build" - - name: Copy new VSC image to VSC nodes expect: command: "{{ vsc_image_copy }}" From 78ae4603cf736e9fd94ed2ac43b05a357d82282a Mon Sep 17 00:00:00 2001 From: Sanket Date: Thu, 15 Nov 2018 11:10:18 -0500 Subject: [PATCH 06/10] More changes --- src/roles/common/tasks/vsc-process-vars.yml | 30 ++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/roles/common/tasks/vsc-process-vars.yml b/src/roles/common/tasks/vsc-process-vars.yml index 4ee2d9ccd7..a6b3826ccb 100644 --- a/src/roles/common/tasks/vsc-process-vars.yml +++ b/src/roles/common/tasks/vsc-process-vars.yml @@ -38,24 +38,24 @@ tags: - vsc - - block: +- block: - - name: Find name of VSC TIM File - find: path="{{ nuage_unzipped_files_dir }}/vsc/single_disk" pattern="cpm.tim" recurse=yes - register: rc_vsc_tim_file + - name: Find name of VSC TIM File + find: path="{{ nuage_unzipped_files_dir }}/vsc/single_disk" pattern="cpm.tim" recurse=yes + register: rc_vsc_tim_file - - debug: var=rc_vsc_tim_file verbosity=1 + - debug: var=rc_vsc_tim_file verbosity=1 - - name: Register VSC TIM variables with proper path and image locations for use in other playbooks - set_fact: - vsc_tim_path: "{{ rc_vsc_tim_file.files[0].path | dirname }}" - vsc_tim_file_name: "{{ rc_vsc_tim_file.files[0].path | basename }}" - when: rc_vsc_tim_file.matched > 0 - - when: - - vscs is defined - tags: - - vsc + - name: Register VSC TIM variables with proper path and image locations for use in other playbooks + set_fact: + vsc_tim_path: "{{ rc_vsc_tim_file.files[0].path | dirname }}" + vsc_tim_file_name: "{{ rc_vsc_tim_file.files[0].path | basename }}" + when: rc_vsc_tim_file.matched > 0 + + when: + - vscs is defined + tags: + - vsc - name: Set vscs_check set_fact: vscs_check={{vscs is defined}} From 2099bc8dea5026a3c3c8c762771a2e0532a2f06e Mon Sep 17 00:00:00 2001 From: Sanket Date: Thu, 15 Nov 2018 15:27:33 -0500 Subject: [PATCH 07/10] Remove tab --- src/roles/common/tasks/check-upgrade-prereq.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/roles/common/tasks/check-upgrade-prereq.yml b/src/roles/common/tasks/check-upgrade-prereq.yml index aa11215333..3ed531530d 100644 --- a/src/roles/common/tasks/check-upgrade-prereq.yml +++ b/src/roles/common/tasks/check-upgrade-prereq.yml @@ -38,8 +38,8 @@ when: component_type | default("NONE") == 'vstat' - - name: Check that TIM file was found for VSC - assert: - that: "vsc_tim_path is defined and vsc_tim_file_name is defined" - msg: "Missing VSC TIM image file for {{ hostname }} under the unzipped file directory, please unzip it and issue reset_build" - when: component_type | default("NONE") == 'vsc' +- name: Check that TIM file was found for VSC + assert: + that: "vsc_tim_path is defined and vsc_tim_file_name is defined" + msg: "Missing VSC TIM image file for {{ hostname }} under the unzipped file directory, please unzip it and issue reset_build" + when: component_type | default("NONE") == 'vsc' From 4e7d73623196061c5f7c1ad764ba36fc7289c520 Mon Sep 17 00:00:00 2001 From: Brian Castelli Date: Fri, 16 Nov 2018 15:35:46 -0500 Subject: [PATCH 08/10] update resolved items list --- Documentation/RELEASE_NOTES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/RELEASE_NOTES.md b/Documentation/RELEASE_NOTES.md index 3f42336a3a..243ea6a103 100644 --- a/Documentation/RELEASE_NOTES.md +++ b/Documentation/RELEASE_NOTES.md @@ -4,6 +4,7 @@ ### Resolved Issues * Fix build_vars.yml conversion script +* Require VSC TIM file only for upgrade, not install ## Release 3.0.0 From a4d87c126c479652ea71ff40d9372e7ee4ee5760 Mon Sep 17 00:00:00 2001 From: Brian Castelli Date: Fri, 16 Nov 2018 15:40:08 -0500 Subject: [PATCH 09/10] Add new commits --- Documentation/RELEASE_NOTES.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Documentation/RELEASE_NOTES.md b/Documentation/RELEASE_NOTES.md index 243ea6a103..36eda13937 100644 --- a/Documentation/RELEASE_NOTES.md +++ b/Documentation/RELEASE_NOTES.md @@ -3,8 +3,12 @@ ## Release 3.0.1 ### Resolved Issues -* Fix build_vars.yml conversion script +* Add double jinja2 substitution to build_vars.yml conversion script +* Support unicode characters when converting from build_vars.yml * Require VSC TIM file only for upgrade, not install +* Add license +* Remove verbosity from documentation examples +* Remove 'install_everything' error message when running `./metroae help` ## Release 3.0.0 From 44a82cda90c0d92768974674884d0e790877efe9 Mon Sep 17 00:00:00 2001 From: brcastel Date: Fri, 16 Nov 2018 16:16:05 -0500 Subject: [PATCH 10/10] port metroae2 fix to croxley --- src/roles/vnsutil-postdeploy/tasks/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/roles/vnsutil-postdeploy/tasks/main.yml b/src/roles/vnsutil-postdeploy/tasks/main.yml index 57d5b4471b..4fefbfb10c 100644 --- a/src/roles/vnsutil-postdeploy/tasks/main.yml +++ b/src/roles/vnsutil-postdeploy/tasks/main.yml @@ -7,18 +7,18 @@ state: directory - name: Create and transfer certs - include_role: + include_role: name: common tasks_from: vsd-generate-transfer-certificates - vars: + vars: certificate_password: "{{ vnsutil_default_password }}" certificate_username: proxy commonName: proxy certificate_type: server scp_user: "{{ vnsutil_default_username }}" scp_location: /opt/proxy/config/keys - additional_parameters: -d {{ inventory_hostname }} - + additional_parameters: -d {{ data_fqdn | default(inventory_hostname) }} + - name: Install supervisord and haproxy command: "{{ install_cmd }}"