[openstack-dev] [heat][yaql] Heat map replacement options

Steven Hardy shardy at redhat.com
Tue Jul 19 15:04:33 UTC 2016


On Fri, Jul 15, 2016 at 10:25:39AM +0100, Steven Hardy wrote:
> Hi all,
> 
> I'm trying to figure out the cleanest way to do a replacement of values in
> a mapping (json parameter) in a heat template, e.g:
> 
>   ServiceNetMap:
>     type: json
>     default:
>       IronicApiNetwork: internal_api
>       CephPublicNetwork: storage
> 
>   NetIpMap:
>     type: json
>     default:
>       storage: 192.0.2.2
>       internal_api: 192.0.2.5
> 
> How do I get
>   OutputMap:
>     IronicApiNetwork: 192.0.2.5
>     CephPublicNetwork: 192.0.2.2
> 
> It seems like something yaql should be able to do, but I've so far failed
> to figure out the syntax.
> 
> The other (possibly simpler) possibility is to implement a new hot
> function, e.g something like:
> 
>   map_replace:
>     template: {get_param: ServiceNetMap}
>     value_replacements: {get_param: NetIpMap}

As a follow-up to this, I have posted this spec and implementation for
map_replace (syntax differs slightly from the keys above):

https://review.openstack.org/#/c/343696/

https://review.openstack.org/#/c/343731/

My aim is a simpler interface to the yaql example previously discussed, and
a better error path when things like key collisions occur. Reviews welcome! :)

Steve



More information about the OpenStack-dev mailing list