Steps to reproduce:
1)Create plugin that inject 2 tasks in post_deployment stage, in this example - code below:
- id: set-compute-local-ephemeral
type: puppet
version: 2.0.0
role: [compute]
required_for: [post_deployment_end]
requires: [ceph-compute]
refresh_on: [nova_config, nova_paste_api_ini]
parameters:
puppet_manifest: "ephemeral-compute.pp"
puppet_modules: "puppet/modules:/etc/puppet/modules"
timeout: 120
- id: create-nova-aggregates
type: puppet
version: 2.0.0
role: [primary-controller]
required_for: [post_deployment_end]
requires: [ceph_create_pools]
reexecute_on: [deploy_changes]
parameters:
puppet_manifest: "create-aggregates.pp"
puppet_modules: "puppet/modules:/etc/puppet/modules"
timeout: 120
2)Create ENV and enable plugin
3)Deploy ENV
4)After deployment finish - add new node with "Compute" role
5)Deploy changes
Actual results - task 'create-nova-aggregates' is not executing on primary-controller.
Expected result - task should be executed.
This is MOS8 with role-based deployment.
I've done some investigation and here's what I found:
* All nodes that are:
* not going to be deployed
* and not going to be deleted
* and have 'ready' status
will be selected for resetup.
* For resetup nodes, we're going to execute tasks marked with "reexecute_on: [deploy_changes]" parameter.
* The graph returns both pre- and post- and main deployment tasks.
* However, WE DO NOT send selected "reexecute_on" pre- and post- deployment tasks to Astute. We only mix main deployment tasks.
The buggy code:
https:/ /github. com/openstack/ fuel-web/ blob/26028971b4 93a4e47e18e8aa9 c8b3a0fb91df8d8 /nailgun/ nailgun/ task/manager. py#L401- L403
Fixing such code might have destructive effect for MU, since we do not guarantee that plugin node roles are ready to have "rexecuted_on" tasks provides by other plugins (if there're any with role: *).