Exporting a Template

Export an existing stack template as a YAML document from Oracle Cloud Stack. After exporting the template you can update it or use it to create a new template.

Exporting a Published Template with the Console

Use the web console to export a published template file from Oracle Cloud Stack.

  1. Access the Oracle Cloud Stack console, and then click Templates.
  2. To the right of the template that you want to export, click Download this template Download icon.
  3. Follow the instructions in your web browser to save the YAML template file on your local machine.

Exporting an Unpublished Template with the Console

Use the web console to export an unpublished (draft) template file from Oracle Cloud Stack.

  1. Access the Oracle Cloud Stack console, and then click Templates.
  2. Click Unpublished.
  3. Click the template that you want to export.
  4. Click Export the current template Cloud icon with down arrow.
  5. Enter a file name for the template, and then click OK.
  6. Follow the instructions in your web browser to save the YAML file on your local machine.

Exporting a Template with the CLI

Use the CLI to export a template file from Oracle Cloud Stack.

  1. Identify the name of the template to export. Execute the stack list-templates command.
  2. Execute the stack export-template command. Provide the name of the template and redirect the output to a file:
    psm stack export-template -n templateName > fileName

    For example:

    psm stack export-template -n MyTemplateName > MyTemplateName.yaml
    

    The command results in a YAML document that contains the template definition:

    ---
      template:
        templateName: MyTemplateName
        templateVersion: 1.0
        templateDescription: My Oracle cloud stack template
        . . .

After exporting the template you can modify its definition using any text editor. If you want to create a new template from the exported document modify the document’s templateName property. After you’re finished changing the template, import the document back into Oracle Cloud Stack. See Importing a Template.

For more information about the CLI commands for Oracle Cloud Stack, see psm stack Commands.