Merge pull request #10412 from adeniyistephen/hlc-doc

Add hcl Example to openstack
This commit is contained in:
Megan Marsh 2021-01-04 09:44:52 -08:00 committed by GitHub
commit 4b0de7263e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 89 additions and 0 deletions

View File

@ -93,6 +93,9 @@ builder.
Here is a basic example. This is a example to build on DevStack running in a Here is a basic example. This is a example to build on DevStack running in a
VM. VM.
<Tabs>
<Tab heading="JSON">
```json ```json
{ {
"type": "openstack", "type": "openstack",
@ -110,11 +113,35 @@ VM.
} }
``` ```
</Tab>
<Tab heading="HCL2">
```hcl
builders "openstack" {
identity_endpoint = "http://<devstack-ip>:5000/v3"
tenant_name = "admin"
domain_name = "Default"
username = "admin"
password = "<your admin password>"
region = "RegionOne"
ssh_username = "root"
image_name = "Test image"
source_image = "<image id>"
flavor = "m1.tiny"
insecure = "true"
}
```
</Tab>
</Tabs>
## Basic Example: Rackspace public cloud ## Basic Example: Rackspace public cloud
Here is a basic example. This is a working example to build a Ubuntu 12.04 LTS Here is a basic example. This is a working example to build a Ubuntu 12.04 LTS
(Precise Pangolin) on Rackspace OpenStack cloud offering. (Precise Pangolin) on Rackspace OpenStack cloud offering.
<Tabs>
<Tab heading="JSON">
```json ```json
{ {
"type": "openstack", "type": "openstack",
@ -127,12 +154,32 @@ Here is a basic example. This is a working example to build a Ubuntu 12.04 LTS
"flavor": "2" "flavor": "2"
} }
``` ```
</Tab>
<Tab heading="HCL2">
```hcl
builders "openstack" {
username = "foo"
password = "foo"
region = "DFW"
ssh_username = "root"
image_name = "Test image"
source_image = "23b564c9-c3e6-49f9-bc68-86c7a9ab5018"
flavor = "2"
}
```
</Tab>
</Tabs>
## Basic Example: Private OpenStack cloud ## Basic Example: Private OpenStack cloud
This example builds an Ubuntu 14.04 image on a private OpenStack cloud, powered This example builds an Ubuntu 14.04 image on a private OpenStack cloud, powered
by Metacloud. by Metacloud.
<Tabs>
<Tab heading="JSON">
```json ```json
{ {
"type": "openstack", "type": "openstack",
@ -142,6 +189,21 @@ by Metacloud.
"flavor": "2" "flavor": "2"
} }
``` ```
</Tab>
<Tab heading="HCL2">
```hcl
builders "openstack" {
ssh_username = "root"
image_name = "ubuntu1404_packer_test_1"
source_image = "91d9c168-d1e5-49ca-a775-3bfdbb6c97f1"
flavor = "2"
}
```
</Tab>
</Tabs>
In this case, the connection information for connecting to OpenStack doesn't In this case, the connection information for connecting to OpenStack doesn't
appear in the template. That is because I source a standard OpenStack script appear in the template. That is because I source a standard OpenStack script
@ -182,6 +244,9 @@ A basic example of Instance with a remote root Block Storage service volume.
This is a working example to build an image on private OpenStack cloud powered This is a working example to build an image on private OpenStack cloud powered
by Selectel VPC. by Selectel VPC.
<Tabs>
<Tab heading="JSON">
```json ```json
{ {
"type": "openstack", "type": "openstack",
@ -200,6 +265,30 @@ by Selectel VPC.
"volume_type": "fast.ru-3a" "volume_type": "fast.ru-3a"
} }
``` ```
</Tab>
<Tab heading="HCL2">
```hcl
builders "openstack" {
identity_endpoint = "https://api.selvpc.com/identity/v3"
tenant_id = "2e90c5c04c7b4c509be78723e2b55b77"
username = "foo"
password = "foo"
region = "ru-3"
ssh_username = "root"
image_name = "Test image"
source_image = "5f58ea7e-6264-4939-9d0f-0c23072b1132"
networks = "9aab504e-bedf-48af-9256-682a7fa3dabb"
flavor = "1001"
availability_zone = "ru-3a"
use_blockstorage_volume = true
volume_type = "fast.ru-3a"
}
```
</Tab>
</Tabs>
## Notes on OpenStack Authorization ## Notes on OpenStack Authorization