Rocky based deployment fails with the msg "No variable found with this name: pre_deployments_ROLE"

Bug #1845268 reported by Cagri Ersen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
New
Undecided
Unassigned

Bug Description

Description
===========
Rocky based deployment fails with an error related to a non-existent variable:

Server deployments task from /var/lib/mistral/overcloud/deploy_steps_playbook.yaml lookups for a variable like pre_deployments_<ROLE> which couldn't be found and throw an error like below:

```
2019-09-24 23:44:38,983 p=6194 u=mistral | fatal: [controller-0]: FAILED! => {"msg": "No variable found with this name: pre_deployments_Controller"}
...so on
```

When I check the variables in /var/lib/mistrarl/<STACKNAME> folder, I see <ROLE>_pre_deployments variable in group_vars/<ROLE> files for example:
```
Controller_pre_deployments:
  - NetworkDeployment
  - ControllerDeployment
  - ControllerHostsDeployment
  - ControllerAllNodesDeployment
  - ControllerAllNodesValidationDeployment
  - ControllerArtifactsDeploy
```

But there is no variable like pre_deployments_Controller which could be the source of the issue imho.

Steps to reproduce
==================
- Install and prepare undercloud
- Create custom templates for a HCI environment.
- Do overcloud deployment with:
```
openstack overcloud deploy \
  --timeout 120 \
  --templates \
  -r ~/templates/roles_data.yaml \
  -n ~/templates/network_data.yaml \
  -e /tmp/templates/environments/network-isolation.yaml \
  -e /tmp/templates/environments/network-environment.yaml \
  -e ~/templates/nic-mapping.yaml \
  -e ~/templates/network.yaml \
  -e ~/templates/node-info.yaml \
  -e ~/templates/scheduler_hints_env.yaml \
  -e ~/templates/ips-from-pool-all.yaml \
  -e ~/templates/fixed-ip-vips.yaml \
  -e ~/templates/ceph-custom-config.yaml \
  -e /tmp/templates/environments/ceph-ansible/ceph-ansible.yaml \
  -e /tmp/templates/environments/ceph-ansible/ceph-rgw.yaml \
  -e /tmp/templates/environments/disable-telemetry.yaml \
  -e ~/templates/misc-settings.yaml \
  -e ~/templates/timezone.yaml
```

Expected result
===============
Ansible task named Server deployment should be passed w/o any error.

Actual result
=============
Fails with a bunch of error like below:
```
2019-09-24 23:44:38,983 p=6194 u=mistral | fatal: [controller-0]: FAILED! => {"msg": "No variable found with this name: pre_deployments_Controller"}

```
Environment
===========
1. Openstack Rocky

2. 10 baremetal node (3 controller + 7 ComputeHCI node)

Revision history for this message
Rabi Mishra (rabi) wrote :

Looks like this was changed recently with https://bugs.launchpad.net/tripleo/+bug/1842141.

After https://review.opendev.org/#/c/680722/ and https://review.opendev.org/#/c/680724/, pre_deployments_{{ role }} is the var rather than {{ role }}_pre_deployments.

I think tripleo-common in your undercloud mistral containers are old.

Revision history for this message
Cagri Ersen (cagri-ersen) wrote :

The docker images come from https://hub.docker.com/u/tripleorocky and it seems all of them include tripleo-common version is 9.6.1 (which should be 9.6.2 i think.)

As a workaround I've changed /usr/share/openstack-tripleo-heat-templates/common/deploy-steps.j2 file, pre and post deployment conditions like below:

```
with_items: "{{ '{{' }} lookup('vars', tripleo_role_name + '_pre_deployments')|default([]) {{ '}}' }}"```

```
with_items: "{{ '{{' }} lookup('vars', tripleo_role_name + '_post_deployments')|default([]) {{ '}}' }}"
```

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.