-
Notifications
You must be signed in to change notification settings - Fork 63
Added correct docker and terraform configuration command #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,9 +48,14 @@ $ make build | |
| $ ls $GOPATH/bin/terraform-provider-cloudstack | ||
| ``` | ||
| Once the build is ready, you have to copy the binary into Terraform locally (version appended). | ||
| On Linux this path is at ~/.terraform.d/plugins, and on Windows at %APPDATA%\terraform.d\plugins. | ||
|
|
||
| On Linux and Mac this path is at ~/.terraform.d/plugins, | ||
| On Windows at %APPDATA%\terraform.d\plugins, | ||
|
|
||
| ```sh | ||
| $ ls ~/.terraform.d/plugins/registry.terraform.io/cloudstack/cloudstack/0.4.0/linux_amd64/terraform-provider-cloudstack_v0.4.0 | ||
| $ cd ~ | ||
| $ mkdir -p .terraform.d/plugins/localdomain/provider/cloudstack/0.4.0/linux_amd64 | ||
| $ cp $GOPATH/bin/terraform-provider-cloudstack .terraform.d/plugins/localdomain/provider/cloudstack/0.4.0/linux_amd64 | ||
|
yadvr marked this conversation as resolved.
Outdated
|
||
| ``` | ||
|
|
||
| Testing the Provider | ||
|
|
@@ -65,8 +70,17 @@ $ make test | |
| In order to run the full suite of Acceptance tests you will need to run the CloudStack Simulator. Please follow these steps to prepare an environment for running the Acceptance tests: | ||
|
|
||
| ```sh | ||
| $ docker pull cloudstack/simulator | ||
| $ docker run --name simulator -p 8080:5050 -d cloudstack/simulator | ||
| docker pull apache/cloudstack-simulator | ||
|
|
||
| or pull it with a particular build tag | ||
|
|
||
| docker pull apache/cloudstack-simulator:4.17.2.0 | ||
|
|
||
| docker run --name simulator -p 8080:5050 -d apache/cloudstack-simulator | ||
|
|
||
| or | ||
|
|
||
| docker run --name simulator -p 8080:5050 -d apache/cloudstack-simulator:4.17.2.0 | ||
| ``` | ||
|
|
||
| When Docker started the container you can go to http://localhost:8080/client and login to the CloudStack UI as user `admin` with password `password`. It can take a few minutes for the container is fully ready, so you probably need to wait and refresh the page for a few minutes before the login page is shown. | ||
|
|
@@ -91,16 +105,16 @@ In order for all the tests to pass, you will need to create a new (empty) projec | |
| $ make testacc | ||
| ``` | ||
|
|
||
| Sample Terraform configuration | ||
| ------------------------------ | ||
| Sample Terraform configuration when testing locally | ||
| ------------------------------------------------------------ | ||
| Below is an example configuration to initialize provider and create a Virtual Machine instance | ||
|
|
||
| ```sh | ||
| $ cat provider.tf | ||
| terraform { | ||
| required_providers { | ||
| cloudstack = { | ||
| source = "cloudstack/cloudstack" | ||
| source = "localdomain/provider/cloudstack" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The previous one worked when I was testing locally @kiranchavala , may you want to add what localdomain/provider means ?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. after building the terraform provider locally using "make build", the generated go binary will contain the new code changes To test the changes we have to use If we use " source "cloudstack/cloudstack" , when "terraform init" is called terraform will download the binary from terraform registry https://registry.terraform.io/providers/cloudstack/cloudstack/latest and place it /.terraform.d/plugins/registry.terraform.io/cloudstack/cloudstack/0.4.0/linux_amd64/terraform-provider-cloudstack_v0.4.0/ If replace the binary with the binary we had built in the same path and do a "terraform apply" , you will encounter a checksum error as terraform.lock.hcl will be different
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks @kiranchavala I used to delete the lock file to test my changes, so that way it worked. |
||
| version = "0.4.0" | ||
| } | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.