fog-openstack icon indicating copy to clipboard operation
fog-openstack copied to clipboard

Add template_url documentation

Open ioggstream opened this issue 8 years ago • 1 comments
trafficstars

I expect

Documentation to reference a stack creation via :template_url https://github.com/fog/fog-openstack/blob/master/docs/orchestration.md

Instead

Only :template is documented

Note

  • template_url may cause issues when templates contain type or get_file

  • python client implementation in shade retrieves and processes the template from :template_uri as follow:

    • search every occurrence of type and get_file
    • if it's not an URI, create an URI out of it, eg.
    • populate the files parameter
    • replaces :template_uri with :template

Here's the request trace:

>>> template_url = "https://raw.githubusercontent.com/ioggstream/heat-templates/test_fog/hot/fog_1.yaml"`
>>> shade_client.create_stack('test', template_url=template_ur)
REQ: curl -g -i -X POST https://heat.example.com -H "User-Agent: python-heatclient" ... -d '
{
 "stack_name": "d4", 
 "files": {
  "https://raw.githubusercontent.com/ioggstream/heat-templates/test_fog/hot/fog_2.yaml": "snip"
 }, 
 "template": {
  "heat_template_version": "newton", 
  "resources": {
   "a_file": {
    "type": "https://raw.githubusercontent.com/ioggstream/heat-templates/test_fog/hot/fog_2.yaml"
   } } },
 ...
}
'

shade code is here https://github.com/openstack-infra/shade/blob/master/shade/openstackcloud.py#L1201

ioggstream avatar Oct 17 '17 09:10 ioggstream

@seanhandley @Ladas @bzwei Please check this comment on using template_url in heat. In fog we could either:

  • ignore file resolution when template_url is used;
  • inherit the heatclient / shade behavior and replace it with a parsed template.

Consider that if both template and template_url are specified, heat server ignores template_url.

This will impact on both fog documentation and behavior.

ioggstream avatar Oct 18 '17 09:10 ioggstream