Switch to more specific include modules for ffwd.

Include has some unintuitive behaviours depending on
if it is running in a static or dynamic in play or in playbook context,
in an effort to clarify behaviours move to a new set of modules:
  include_tasks, include_role, import_playbook, import_tasks.

Change-Id: I32198527a084d35f8a2c91e3e7d3f32b6fbe9e1e
This commit is contained in:
Yurii Prokulevych 2019-01-22 11:07:39 +01:00
parent 43157f6a85
commit d67e6e7166
4 changed files with 84 additions and 34 deletions

View File

@ -1,6 +1,9 @@
---
- name: create a comptatible deployment scripts from oooq
include: ../upgrade/use_oooq.yaml
include_tasks: ../upgrade/use_oooq.yaml
args:
apply:
tags: use_oooq
tags: use_oooq
when: use_oooq|bool
@ -21,16 +24,16 @@
- composable_scenario|default("")
- name: Convert CLI options to parameters
include: ../common/convert_cli_opts_params.yaml
import_tasks: ../common/convert_cli_opts_params.yaml
- name: get auxiliary facts for upgrade
include: ../common/auxilary-facts.yaml
import_tasks: ../common/auxilary-facts.yaml
- name: Convert Ceph parameters to ceph ansible
include: ../common/convert_ceph_params.yaml
import_tasks: ../common/convert_ceph_params.yaml
- name: Adjust custom roles data file during upgrade
include: convert_roles_data.yaml
import_tasks: convert_roles_data.yaml
- name: create ffu upgrade workaround scripts
template:
@ -72,14 +75,17 @@
dest: "{{ working_dir }}/ceph-upgrade-run.sh"
mode: 0755
- include: ../common/ssh_config_skip_host.yml
- name: import ssh_config_skip_host tasks
import_tasks: ../common/ssh_config_skip_host.yml
- include: ../common/create_l3_agent_connectivity_check_script.yml
- name: import create_l3_agent_connectivity_check_script tasks
import_tasks: ../common/create_l3_agent_connectivity_check_script.yml
- include: ../common/create_l3_agent_failover_check_script.yml
- name: import create_l3_agent_failover_check_script tasks
import_tasks: ../common/create_l3_agent_failover_check_script.yml
- name: create nova actions check script
include: ../common/create_nova_actions_check_script.yml
import_tasks: ../common/create_nova_actions_check_script.yml
- name: import create HTTP test scripts
import_tasks: ../common/create_http_test_scripts.yml

View File

@ -1,10 +1,18 @@
---
- name: create upgrade prepare scripts
include: create-prepare-scripts.yaml
include_tasks: create-prepare-scripts.yaml
args:
apply:
tags:
- create_ffu_prepare_scripts
tags: create_ffu_prepare_scripts
- name: create fast forward upgrade scripts
include: create-ffu-scripts.yaml
include_tasks: create-ffu-scripts.yaml
args:
apply:
tags:
- create_ffu_scripts
tags: create_ffu_scripts
loop_control:
loop_var: current_release
@ -13,7 +21,7 @@
- block:
- name: ffu undercloud upgrade
include: undercloud-upgrade.yml
include_tasks: undercloud-upgrade.yml
loop_control:
loop_var: current_release
with_items: "{{ ffu_undercloud_releases }}"
@ -32,7 +40,11 @@
tags: ffu_upgrade_playbook
become: true
- include: "{{ item }}"
- name: start L3 verification scripts
include_tasks: "{{ item }}"
args:
apply:
tags: ffu_overcloud_prepare
with_items:
- '../common/l3_agent_connectivity_check_start_script.yml'
- '../common/l3_agent_failover_check_pre_script.yml'
@ -43,7 +55,8 @@
when: ffu_upgrade_workarounds|bool
tags: ffu_overcloud_prepare
- include: ../common/convert_nic_templates.yaml
- name: convert nic templates
import_tasks: ../common/convert_nic_templates.yaml
tags: ffu_overcloud_prepare
- name: set upgrade_prepare_extra_params for ffu prepare with custom repos
@ -56,10 +69,15 @@
upgrade_prepare_extra_params: '{{ upgrade_prepare_extra_params + ["{{ tht_directory }}/environments/updates/update-from-deployed-server-newton.yaml"] }}'
when: deployed_server|default(false)|bool
- include: ../upgrade/overcloud_upgrade_prepare.yml
- name: run overcloud upgrade prepare
import_tasks: ../upgrade/overcloud_upgrade_prepare.yml
tags: ffu_overcloud_prepare
- include: "{{ item }}"
- name: stop L3 verification scripts
include_tasks: "{{ item }}"
args:
apply:
tags: ffu_overcloud_prepare
with_items:
- '../common/l3_agent_connectivity_check_stop_script.yml'
- '../common/l3_agent_failover_check_post_script.yml'
@ -70,24 +88,32 @@
when: ffu_upgrade_workarounds|bool
tags: ffu_overcloud_run
- include: ../common/l3_agent_connectivity_check_start_script.yml
- name: start L3 connectivity script
import_tasks: ../common/l3_agent_connectivity_check_start_script.yml
tags: ffu_overcloud_run
- name: run overcloud fast forward upgrade
command: "{{ working_dir }}/overcloud_upgrade_run.sh"
tags: ffu_overcloud_run
- include: ../common/l3_agent_connectivity_check_stop_script.yml
- name: stop L3 connectivity script
import_tasks: ../common/l3_agent_connectivity_check_stop_script.yml
tags: ffu_overcloud_run
## we can either upgrade all overcloud nodes at one or per role/node
- name: upgrade all overcloud nodes at once
include: overcloud_bulk.yaml
include_tasks: overcloud_bulk.yaml
args:
apply:
tags: ffu_overcloud_upgrade_bulk
tags: ffu_overcloud_upgrade_bulk
when: ffu_bulk|bool
- name: upgrade overcloud nodes per roles
include: overcloud_role.yaml
include_tasks: overcloud_role.yaml
args:
apply:
tags: ffu_overcloud_upgrade_role
tags: ffu_overcloud_upgrade_role
when: not ffu_bulk|bool
@ -102,13 +128,19 @@
command: "{{ working_dir }}/overcloud_upgrade_CephStorage.sh"
tags: ffu_overcloud_ceph
- include: ../common/l3_agent_connectivity_check_start_script.yml
- name: start L3 connectivity script
import_tasks: ../common/l3_agent_connectivity_check_start_script.yml
tags: ffu_overcloud_ceph
- include: ../upgrade/ceph_upgrade_run.yml
- name: import ceph ugrade tasks
import_tasks: ../upgrade/ceph_upgrade_run.yml
tags: ffu_overcloud_ceph
- include: "{{ item }}"
- name: stop L3 verification scripts
include_tasks: "{{ item }}"
args:
apply:
tags: ffu_overcloud_ceph
with_items:
- '../common/l3_agent_connectivity_check_stop_script.yml'
- '../common/l3_agent_failover_check_post_script.yml'
@ -119,11 +151,12 @@
when: ffu_upgrade_workarounds|bool
tags: ffu_overcloud_converge
- include: ../upgrade/overcloud_upgrade_converge.yml
- name: import overcloud upgrade converge tasks
import_tasks: ../upgrade/overcloud_upgrade_converge.yml
tags: ffu_overcloud_converge
- name: run post upgrade actions
include: ../common/nova_actions_check.yml
import_tasks: ../common/nova_actions_check.yml
tags: ffu_overcloud_post
when: ffu_overcloud_upgrade|bool

View File

@ -13,14 +13,19 @@
when: ffu_upgrade_workarounds|bool
tags: ffu_overcloud_upgrade
- include: ../common/l3_agent_connectivity_check_start_script.yml
- name: import ../common/l3_agent_connectivity_check_start_script tasks
import_tasks: ../common/l3_agent_connectivity_check_start_script.yml
tags: ffu_overcloud_upgrade
- name: run all roles upgrade steps
command: "{{ working_dir }}//overcloud_upgrade_all.sh"
tags: ffu_overcloud_upgrade
- include: "{{ item }}"
- name: include L3 connectivity tasks
include_tasks: "{{ item }}"
args:
apply:
tags: ffu_overcloud_upgrade
with_items:
- '../common/l3_agent_connectivity_check_stop_script.yml'
- '../common/l3_agent_failover_check_post_script.yml'

View File

@ -1,6 +1,6 @@
---
- name: generate roles list from inventory file
include: ../common/load_roles_from_inventory.yaml
import_tasks: ../common/load_roles_from_inventory.yaml
- name: create FFU role ugrades scripts
template:
@ -10,7 +10,8 @@
tags: ffu_overcloud_upgrade_controller
with_items: "{{ oc_roles|default([]) }}"
- include: ../common/l3_agent_connectivity_check_start_script.yml
- name: start L3 connectivity check
import_tasks: ../common/l3_agent_connectivity_check_start_script.yml
tags: ffu_overcloud_upgrade_controller
- name: pre controller role upgrade steps workarounds
@ -24,13 +25,15 @@
with_items:
- "{{ oc_roles|difference(['Compute','ComputeAlt','CephStorage']) }}"
- include: "{{ item }}"
- name: run L3 validation
include_tasks: "{{ item }}"
with_items:
- '../common/l3_agent_connectivity_check_stop_script.yml'
- '../common/l3_agent_failover_check_post_script.yml'
tags: ffu_overcloud_upgrade_controller
- include: ../common/l3_agent_connectivity_check_start_script.yml
- name: start L3 connectivity check
import_tasks: ../common/l3_agent_connectivity_check_start_script.yml
tags: ffu_overcloud_upgrade_compute
- name: run FFU compute ugrade scripts
@ -41,7 +44,8 @@
when:
- not ffu_computes_rolling|bool
- include: ../common/l3_agent_connectivity_check_stop_script.yml
- name: validate L3 connectivity result
import_tasks: ../common/l3_agent_connectivity_check_stop_script.yml
tags: ffu_overcloud_upgrade_compute
- block:
@ -60,7 +64,8 @@
with_items:
- '{{ tripleo_compute_nodes.stdout_lines }}'
- include: ../common/l3_agent_connectivity_check_start_script.yml
- name: start L3 connectivity check
import_tasks: ../common/l3_agent_connectivity_check_start_script.yml
tags: ffu_overcloud_upgrade_compute
- name: Rolling upgrade compute nodes
@ -69,6 +74,7 @@
with_items:
- '{{ tripleo_compute_nodes.stdout_lines }}'
- include: ../common/l3_agent_connectivity_check_stop_script.yml
- name: validate L3 connectivity result
import_tasks: ../common/l3_agent_connectivity_check_stop_script.yml
tags: ffu_overcloud_upgrade_compute
when: ffu_computes_rolling|bool