From 22544669d840876b99d132449c2960b06416de32 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Thu, 30 Apr 2020 13:23:32 -0600 Subject: [PATCH] Switch deploy steps to tripleo_free The tripleo_free strategy should allow the tasks to run freely for a given playbook that defines using the tripleo_free strategy. The defaul strategy is a linear one that will execute each task across all servers prior to moving to the next task. The tripleo_free strategy will execute the tasks on servers without syncryonizing the tasks within a given playbook. Because TripleO uses step concepts in our deployment, we already have the syncronization points in the main playbook. The outer playbook should be done linearly but the deployment steps themselves should be done freely. The tripleo_free playbook won't stop execution on all hosts if one host fails or becomes unreachable. It will however end the play exeuction if any error occurs on any host. This is similar to the deployment failures we used to have with Heat where a failure on any single node would stop the deployment at a given deployment step. A future improvement of this will be to add logic to handle a failure percentage on a given TripleO role to only stop the playbook if the failure percentage exceeds a defined amount. Currently any failure will stop a playbook but may not stop later tasks from executing on the rest of the hosts. We will likely need to implement a tripleo_linear strategy based on the upstream linear strategy to understand these failure percentages as well. NOTE: During the testing of this, we identified two issues with the free strategy in ansible itself. We will need those fixes landed in the version of ansible prior to being able to land this. Depends-On: https://github.com/ansible/ansible/pull/69730 Depends-On: https://github.com/ansible/ansible/pull/69524 Change-Id: Ib4a02a192377aafab5970647d74977cb1189bcae (cherry picked from commit a5f9740759461434177d6590cc8c99bb5e48365b) --- common/deploy-steps.j2 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2 index b66a2bb658..bb36cf8fef 100644 --- a/common/deploy-steps.j2 +++ b/common/deploy-steps.j2 @@ -488,6 +488,7 @@ outputs: - common_roles - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST + strategy: tripleo_free name: Deploy step tasks for step 0 become: true gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}" @@ -512,6 +513,7 @@ outputs: - step0 - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST + strategy: tripleo_free name: Server pre deployment steps gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}" any_errors_fatal: yes @@ -522,6 +524,7 @@ outputs: - pre_deploy_steps - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST + strategy: tripleo_free name: Server deployments gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}" any_errors_fatal: yes @@ -648,6 +651,7 @@ outputs: {% endraw %} - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST + strategy: tripleo_free name: Host prep steps become: true gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}" @@ -683,6 +687,7 @@ outputs: {%- for step in range(1,deploy_steps_max) %} - hosts: DEPLOY_SOURCE_HOST + strategy: tripleo_free name: External deployment step {{step}} gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}" any_errors_fatal: yes @@ -712,6 +717,7 @@ outputs: - step{{step}} - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST + strategy: tripleo_free name: Deploy step tasks for {{step}} become: true gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}" @@ -792,6 +798,7 @@ outputs: {%- endfor %} - hosts: {{primary_role_name}}:DEPLOY_TARGET_HOST + strategy: tripleo_free name: Server Post Deployments become: true gather_facts: "{% raw %}{{ gather_facts | default(false) }}{% endraw %}"