azlin template export¶
Export a VM template to a file for sharing or version control.
Description¶
Export templates to share with team members, back up configurations, or store in Git repositories.
Usage¶
Arguments¶
TEMPLATE_NAME- Template to exportOUTPUT_FILE- Destination file path
Options¶
| Option | Description |
|---|---|
--format FORMAT | Export format: yaml, json (default: yaml) |
--overwrite | Overwrite existing file |
-h, --help | Show help message |
Examples¶
Export Template to File¶
Output:
Exporting template 'dev-vm'...
Source: ~/.azlin/templates/dev-vm.yaml
Destination: ~/templates/dev-vm.yaml
✓ Template exported successfully!
Export to JSON¶
Export All Templates¶
mkdir -p ~/azlin-templates-backup
for template in $(azlin template list --format json | jq -r '.templates[].name'); do
azlin template export $template ~/azlin-templates-backup/$template.yaml
done
Common Workflows¶
Team Sharing¶
# Export template
azlin template export team-dev /shared/templates/team-dev.yaml
# Team members import
azlin template import /shared/templates/team-dev.yaml
Version Control¶
# Export all templates to Git repo
mkdir -p ~/git/azlin-templates
cd ~/git/azlin-templates
git init
for template in $(azlin template list --format json | jq -r '.templates[].name'); do
azlin template export $template $template.yaml
done
git add *.yaml
git commit -m "Export azlin templates"
git push
Related Commands¶
azlin template import- Import templateazlin template create- Create templateazlin template list- List templates