summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-11-29 18:57:54 +0000
committerGerrit Code Review <review@openstack.org>2018-11-29 18:57:54 +0000
commit4aebc0670735a18b25664a77d4b2572e122352f4 (patch)
tree448c284c91cbd3399f56c43475d49895bf39748b
parentb7385790e5ad7cb02fada69d232cd0347fcfa509 (diff)
parentc2a98b3d90548f5c0a9ca77216238c58e2bfafbc (diff)
Merge "Pre-cleanup migration resources and fix validation"
-rw-r--r--migration/tripleo_environment/playbooks/roles/post-migration/tasks/main.yml14
-rw-r--r--migration/tripleo_environment/playbooks/roles/pre-migration/tasks/main.yml12
-rw-r--r--migration/tripleo_environment/playbooks/roles/resources/cleanup/defaults/main.yml2
-rw-r--r--migration/tripleo_environment/playbooks/roles/resources/cleanup/tasks/main.yml14
-rw-r--r--migration/tripleo_environment/playbooks/roles/resources/create/defaults/main.yml1
-rw-r--r--migration/tripleo_environment/playbooks/roles/resources/create/tasks/main.yml2
-rw-r--r--migration/tripleo_environment/playbooks/roles/resources/validate/defaults/main.yml3
-rw-r--r--migration/tripleo_environment/playbooks/roles/resources/validate/tasks/main.yml2
-rw-r--r--migration/tripleo_environment/playbooks/roles/resources/validate/templates/validate-resources.sh.j22
9 files changed, 39 insertions, 13 deletions
diff --git a/migration/tripleo_environment/playbooks/roles/post-migration/tasks/main.yml b/migration/tripleo_environment/playbooks/roles/post-migration/tasks/main.yml
index e1c4183..5531a28 100644
--- a/migration/tripleo_environment/playbooks/roles/post-migration/tasks/main.yml
+++ b/migration/tripleo_environment/playbooks/roles/post-migration/tasks/main.yml
@@ -8,7 +8,6 @@
8 include_role: 8 include_role:
9 name: resources/validate 9 name: resources/validate
10 vars: 10 vars:
11 ovn_migration_temp_dir: "{{ working_dir }}/pre_migration_resources"
12 restart_server: true 11 restart_server: true
13 when: validate_migration|bool 12 when: validate_migration|bool
14 13
@@ -17,14 +16,21 @@
17 name: resources/cleanup 16 name: resources/cleanup
18 tags: 17 tags:
19 - post-migration 18 - post-migration
20 vars:
21 ovn_migration_temp_dir: "{{ working_dir }}/pre_migration_resources"
22 when: validate_migration|bool 19 when: validate_migration|bool
23 20
24# 21#
25# Create post-migration resources, validate, and then clean up 22# Create post-migration resources, validate, and then clean up
26# 23#
27 24
25# Delete any existing resources to make sure we don't conflict on a second run
26- name: Delete any post migration resources (preventive)
27 include_role:
28 name: resources/cleanup
29 vars:
30 resource_suffix: "post"
31 silent_cleanup: true
32 when: validate_migration|bool
33
28- name: Create post-migration resources 34- name: Create post-migration resources
29 include_role: 35 include_role:
30 name: resources/create 36 name: resources/create
@@ -35,6 +41,8 @@
35- name: Validate post migration resources 41- name: Validate post migration resources
36 include_role: 42 include_role:
37 name: resources/validate 43 name: resources/validate
44 vars:
45 resource_suffix: "post"
38 when: validate_migration|bool 46 when: validate_migration|bool
39 47
40- name: Delete the post migration resources 48- name: Delete the post migration resources
diff --git a/migration/tripleo_environment/playbooks/roles/pre-migration/tasks/main.yml b/migration/tripleo_environment/playbooks/roles/pre-migration/tasks/main.yml
index be3b983..e3ce8e5 100644
--- a/migration/tripleo_environment/playbooks/roles/pre-migration/tasks/main.yml
+++ b/migration/tripleo_environment/playbooks/roles/pre-migration/tasks/main.yml
@@ -1,13 +1,17 @@
1# Delete any existing resources to make sure we don't conflict on a second run
2- name: Delete any existing pre migration resources (preventive)
3 include_role:
4 name: resources/cleanup
5 vars:
6 silent_cleanup: true
7 when: validate_migration|bool
8
1- name: Create the pre migration resource stack 9- name: Create the pre migration resource stack
2 include_role: 10 include_role:
3 name: resources/create 11 name: resources/create
4 vars:
5 ovn_migration_temp_dir: "{{ working_dir }}/pre_migration_resources"
6 when: validate_migration|bool 12 when: validate_migration|bool
7 13
8- name: Validate the pre migration resources 14- name: Validate the pre migration resources
9 include_role: 15 include_role:
10 name: resources/validate 16 name: resources/validate
11 vars:
12 ovn_migration_temp_dir: "{{ working_dir }}/pre_migration_resources"
13 when: validate_migration|bool \ No newline at end of file 17 when: validate_migration|bool \ No newline at end of file
diff --git a/migration/tripleo_environment/playbooks/roles/resources/cleanup/defaults/main.yml b/migration/tripleo_environment/playbooks/roles/resources/cleanup/defaults/main.yml
index dca50f9..32394d8 100644
--- a/migration/tripleo_environment/playbooks/roles/resources/cleanup/defaults/main.yml
+++ b/migration/tripleo_environment/playbooks/roles/resources/cleanup/defaults/main.yml
@@ -2,3 +2,5 @@
2 2
3cleanup_resource_script: cleanup-resources.sh.j2 3cleanup_resource_script: cleanup-resources.sh.j2
4resource_suffix: "pre" 4resource_suffix: "pre"
5ovn_migration_temp_dir: "{{ working_dir }}/{{ resource_suffix }}_migration_resources"
6silent_cleanup: false
diff --git a/migration/tripleo_environment/playbooks/roles/resources/cleanup/tasks/main.yml b/migration/tripleo_environment/playbooks/roles/resources/cleanup/tasks/main.yml
index 53b4a5c..67edbb3 100644
--- a/migration/tripleo_environment/playbooks/roles/resources/cleanup/tasks/main.yml
+++ b/migration/tripleo_environment/playbooks/roles/resources/cleanup/tasks/main.yml
@@ -11,8 +11,16 @@
11 dest: "{{ ovn_migration_temp_dir }}/cleanup-resources.sh" 11 dest: "{{ ovn_migration_temp_dir }}/cleanup-resources.sh"
12 mode: 0744 12 mode: 0744
13 13
14- name: Cleaning up the pre migration resources 14- name: Cleaning up the migration resources (verbose)
15 shell: > 15 shell: >
16 set -o pipefail && 16 set -o pipefail &&
17 {{ ovn_migration_temp_dir }}/cleanup-resources.sh 2>&1 > 17 {{ ovn_migration_temp_dir }}/cleanup-resources.sh 2>&1 | tee
18 cleanup-resources.sh.log 18 {{ ovn_migration_temp_dir }}/cleanup-resources.sh.log
19
20 when: not silent_cleanup
21
22- name: Cleaning up the migration resources (silent)
23 shell: >
24 {{ ovn_migration_temp_dir }}/cleanup-resources.sh >/dev/null 2>&1
25 when: silent_cleanup
26
diff --git a/migration/tripleo_environment/playbooks/roles/resources/create/defaults/main.yml b/migration/tripleo_environment/playbooks/roles/resources/create/defaults/main.yml
index bbc77bc..401f8c7 100644
--- a/migration/tripleo_environment/playbooks/roles/resources/create/defaults/main.yml
+++ b/migration/tripleo_environment/playbooks/roles/resources/create/defaults/main.yml
@@ -2,3 +2,4 @@
2 2
3create_migration_resource_script: create-resources.sh.j2 3create_migration_resource_script: create-resources.sh.j2
4resource_suffix: "pre" 4resource_suffix: "pre"
5ovn_migration_temp_dir: "{{ working_dir }}/{{ resource_suffix }}_migration_resources"
diff --git a/migration/tripleo_environment/playbooks/roles/resources/create/tasks/main.yml b/migration/tripleo_environment/playbooks/roles/resources/create/tasks/main.yml
index a2b6e3b..b30c812 100644
--- a/migration/tripleo_environment/playbooks/roles/resources/create/tasks/main.yml
+++ b/migration/tripleo_environment/playbooks/roles/resources/create/tasks/main.yml
@@ -18,5 +18,5 @@
18- name: Creating migration resources 18- name: Creating migration resources
19 shell: > 19 shell: >
20 set -o pipefail && 20 set -o pipefail &&
21 {{ ovn_migration_temp_dir }}/create-migration-resources.sh 2>&1 > 21 {{ ovn_migration_temp_dir }}/create-migration-resources.sh 2>&1 | tee
22 {{ ovn_migration_temp_dir }}/create-migration-resources.sh.log 22 {{ ovn_migration_temp_dir }}/create-migration-resources.sh.log
diff --git a/migration/tripleo_environment/playbooks/roles/resources/validate/defaults/main.yml b/migration/tripleo_environment/playbooks/roles/resources/validate/defaults/main.yml
index 60628e5..549535e 100644
--- a/migration/tripleo_environment/playbooks/roles/resources/validate/defaults/main.yml
+++ b/migration/tripleo_environment/playbooks/roles/resources/validate/defaults/main.yml
@@ -1,4 +1,5 @@
1validate_resources_script: validate-resources.sh.j2 1validate_resources_script: validate-resources.sh.j2
2server_user_name: "cirros" 2server_user_name: "cirros"
3restart_server: false 3restart_server: false
4resource_suffix: "pre" \ No newline at end of file 4resource_suffix: "pre"
5ovn_migration_temp_dir: "{{ working_dir }}/{{ resource_suffix }}_migration_resources" \ No newline at end of file
diff --git a/migration/tripleo_environment/playbooks/roles/resources/validate/tasks/main.yml b/migration/tripleo_environment/playbooks/roles/resources/validate/tasks/main.yml
index f01a86c..4d178dc 100644
--- a/migration/tripleo_environment/playbooks/roles/resources/validate/tasks/main.yml
+++ b/migration/tripleo_environment/playbooks/roles/resources/validate/tasks/main.yml
@@ -7,6 +7,6 @@
7- name: Run the validation script 7- name: Run the validation script
8 shell: > 8 shell: >
9 set -o pipefail && 9 set -o pipefail &&
10 {{ ovn_migration_temp_dir }}/validate-resources.sh 2>&1 > 10 {{ ovn_migration_temp_dir }}/validate-resources.sh 2>&1 | tee
11 {{ ovn_migration_temp_dir }}/validate-resources.sh.log 11 {{ ovn_migration_temp_dir }}/validate-resources.sh.log
12 12
diff --git a/migration/tripleo_environment/playbooks/roles/resources/validate/templates/validate-resources.sh.j2 b/migration/tripleo_environment/playbooks/roles/resources/validate/templates/validate-resources.sh.j2
index 30da171..006c5dc 100644
--- a/migration/tripleo_environment/playbooks/roles/resources/validate/templates/validate-resources.sh.j2
+++ b/migration/tripleo_environment/playbooks/roles/resources/validate/templates/validate-resources.sh.j2
@@ -1,6 +1,8 @@
1#!/bin/bash 1#!/bin/bash
2 2
3set -x 3set -x
4set -e
5
4source {{ overcloudrc }} 6source {{ overcloudrc }}
5 7
6# This script validates the resources create by the resources/create role. 8# This script validates the resources create by the resources/create role.