Bug 1288253 - depends_on doesn't work in extraconfig (post_deploy)
depends_on doesn't work in extraconfig (post_deploy)
Status: CLOSED NOTABUG
Product: Red Hat OpenStack
Classification: Red Hat
Component: rhosp-director (Show other bugs)
5.0 (RHEL 7)
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: chris alfonso
yeylon@redhat.com
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-12-03 18:40 EST by Gaëtan Trellu
Modified: 2016-04-18 02:54 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-01-14 09:31:26 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Gaëtan Trellu 2015-12-03 18:40:48 EST
Description of problem:

We having two resources in our extraconfig, we want to orchestrate the execution of these resources but it seems for some reason that the depends_on doesn't work.

Our post deploy action consist to download a Puppet module from a Git repo and then using it. Problem, the "puppet apply" is run before the vcsrepo action...

Version-Release number of selected component (if applicable):
python-rdomanager-oscplugin-0.0.10-8
Y1 release

This our YAML:

heat_template_version: 2014-10-16

parameters:
  servers:
    type: json

resources:

  GetRaxPuppetModuleConfig:
    type: OS::Heat::SoftwareConfig
    properties:
      config: {get_file: rax-get-rpcrmaas.pp}
      group: puppet
      options:
        enable_hiera: True
        enable_facter: False

  GetRaxPuppetModuleDeployments:
    type: OS::Heat::SoftwareDeployments
    depends_on: GetRaxPuppetModuleConfig
    properties:
      config: {get_resource: GetRaxPuppetModuleConfig}
      servers: {get_param: servers}

  ApplyRaxPuppetModuleConfig:
    type: OS::Heat::SoftwareConfig
    depends_on: GetRaxPuppetModuleDeployments
    properties:
      config: {get_file: rax-apply-rpcrmaas.pp}
      group: puppet
      options:
        enable_hiera: True
        enable_facter: False

  ApplyRaxModuleDeployments:
    type: OS::Heat::SoftwareDeployments
    depends_on: ApplyRaxPuppetModuleConfig
    properties:
      config: {get_resource: ApplyRaxPuppetModuleConfig}
      servers: {get_param: servers}

Any idea how to fix that ?

Thanks
Comment 2 Steve Baker 2015-12-04 16:07:49 EST
Execution order on the node is a bit different to resource dependency order.

If you want a predictable execution order you need to set the name property on the deployment(s) resources, so the above example would be:

  GetRaxPuppetModuleConfig:
    type: OS::Heat::SoftwareConfig
    properties:
      config: {get_file: rax-get-rpcrmaas.pp}
      group: puppet
      options:
        enable_hiera: True
        enable_facter: False

  GetRaxPuppetModuleDeployments:
    type: OS::Heat::SoftwareDeployments
    depends_on: GetRaxPuppetModuleConfig
    properties:
      name: 50-GetRaxPuppetModuleDeployments
      config: {get_resource: GetRaxPuppetModuleConfig}
      servers: {get_param: servers}

  ApplyRaxPuppetModuleConfig:
    type: OS::Heat::SoftwareConfig
    depends_on: GetRaxPuppetModuleDeployments
    properties:
      config: {get_file: rax-apply-rpcrmaas.pp}
      group: puppet
      options:
        enable_hiera: True
        enable_facter: False

  ApplyRaxModuleDeployments:
    type: OS::Heat::SoftwareDeployments
    depends_on: ApplyRaxPuppetModuleConfig
    properties:
      name: 60-GetRaxPuppetModuleDeployments
      config: {get_resource: ApplyRaxPuppetModuleConfig}
      servers: {get_param: servers}
Comment 3 Steve Baker 2015-12-04 16:10:15 EST
BTW I'll be pushing some changes upstream so that all deployments have something set for the name, then we can start building some policy about execution order (and merge order for hiera deployments)

http://docs.openstack.org/developer/heat/template_guide/openstack.html#OS::Heat::SoftwareDeploymentGroup-prop-name
Comment 4 Gaëtan Trellu 2015-12-04 16:12:12 EST
Thanks Steve, I will try that !
Comment 5 Gaëtan Trellu 2015-12-08 09:11:31 EST
Steeve, it works !
Thanks
Comment 6 Steven Hardy 2016-01-14 09:31:26 EST
Per comment #5 closing this NOTABUG, as it was a mistake in the template not a director/heat bug.

Note You need to log in before you can comment on or make changes to this bug.