att-comdev / deckhand

This project has moved to OpenStack.
https://www.airshipit.org/
Apache License 2.0
9 stars 5 forks source link

Allow a single source substitution to feed multiple destinations #21

Closed darrendejaeger closed 6 years ago

darrendejaeger commented 6 years ago

Current substitution looks similar to this:

  substitutions:
    - src:
        schema: pegleg/CommonSoftwareConfig/v1
        name: common-software-config
        path: .osh.region_name
      dest:
        path: .osh.keystone.admin.region_name
    - src:
        schema: pegleg/CommonSoftwareConfig/v1
        name: common-software-config
        path: .osh.region_name
      dest:
        path: .osh.cinder.cinder.region_name
...

It would be great if we could do something like this:

  substitutions:
    - src:
        schema: pegleg/CommonSoftwareConfig/v1
        name: common-software-config
        path: .osh.region_name
      dests:
        - path: .osh.keystone.admin.region_name
        - path: .osh.cinder.cinder.region_name
...
codebind-luna commented 6 years ago

I guess it would be something like. otherwise values will be overwritten

substitutions: - src: schema: pegleg/CommonSoftwareConfig/v1 name: common-software-config path: .osh.region_name dests: -path: [.osh.keystone.admin.region_name, .osh.cinder.cinder.region_name] ...

fmontei commented 6 years ago

I believe that

dests:
        - path: .osh.keystone.admin.region_name
        - path: .osh.cinder.cinder.region_name

should be possible as dests is a list of dictionaries so the repeat of path should work.

Switching gears, I think that supporting dest (which is the current syntax) and dests leaves room for silly mistakes (dest and dests are almost identical). I think dest should just be made to support both a single entry (as it does right now) as well as a list of entries.

This way backwards compatibility will be retained and it'll be easier to update existing documents.