Skip to content

Commit

Permalink
Added correct docker and terraform configuration command (#53)
Browse files Browse the repository at this point in the history
* Added correct docker and terraform configuration commands

* Update README.md

Co-authored-by: David Jumani <[email protected]>

* Update README.md

Co-authored-by: David Jumani <[email protected]>

---------

Co-authored-by: Rohit Yadav <[email protected]>
Co-authored-by: David Jumani <[email protected]>
  • Loading branch information
3 people committed Aug 4, 2023
1 parent eaf06e9 commit ea87939
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Testing the Provider
Expand All @@ -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.
Expand All @@ -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"
version = "0.4.0"
}
}
Expand Down

0 comments on commit ea87939

Please sign in to comment.