Skip to content

Commit 7988c03

Browse files
committed
Revamp README
1 parent 3d7638b commit 7988c03

File tree

1 file changed

+35
-32
lines changed

1 file changed

+35
-32
lines changed

README.md

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -44,52 +44,40 @@ What is *NOT* in scope:
4444

4545
This would make the mapping from terraform complicated and not maintanable. See the [How to contribute](CONTRIBUTING.md) section to understand how to approach new features.
4646

47-
## Getting the libvirt provider
47+
## Getting started
4848

49-
The provide is available via the [Terraform Registry](https://registry.terraform.io/providers/dmacvicar/libvirt/latest).
49+
The provide is available for auto-installation from the [Terraform Registry](https://registry.terraform.io/providers/dmacvicar/libvirt/latest).
5050

51-
You can also manually download it from the [releases section](https://github.com/dmacvicar/terraform-provider-libvirt/releases) on Github
51+
In your `main.tf` file, specify the version you want to use:
5252

53-
## Building from source
5453

55-
### Requirements
54+
```hcl
55+
terraform {
56+
required_providers {
57+
libvirt = {
58+
source = "dmacvicar/libvirt"
59+
}
60+
}
61+
}
5662
57-
- [Go](https://golang.org/doc/install) is required for building.
63+
provider "libvirt" {
64+
# Configuration options
65+
}
66+
```
5867

59-
### Building The Provider
68+
And now run terraform init:
6069

6170
```
62-
git clone https://github.com/dmacvicar/terraform-provider-libvirt.git
63-
cd terraform-provider-libvirt
64-
make
71+
$ terraform init
6572
```
6673

67-
The binary will be called `terraform-provider-libvirt`.
68-
69-
# Installing
70-
71-
* Check that libvirt daemon 1.2.14 or newer is running on the hypervisor (`virsh version --daemon`)
72-
* [Terraform](https://www.terraform.io/downloads.html)
73-
* `mkisofs` is required to use the [CloudInit](website/docs/r/cloudinit.html.markdown)
74-
* `xsltproc` is required to transform generated libvirt XML
75-
76-
[Copied from the Terraform documentation](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins):
77-
78-
At present Terraform can automatically install only the providers distributed by HashiCorp. Third-party providers can be manually installed by placing their plugin executables in one of the following locations depending on the host operating system:
79-
80-
> On Linux and unix systems, in the sub-path `.terraform.d/plugins` in your user's home directory.
81-
82-
> On Windows, in the sub-path `terraform.d/plugins` beneath your user's "Application Data" directory.
83-
84-
terraform init will search this directory for additional plugins during plugin initialization.
85-
86-
## Using the provider
74+
### Creating your first virtual machine
8775

8876
Here is an example that will setup the following:
8977

9078
+ A virtual server resource
9179

92-
(create this as libvirt.tf and run terraform commands from this directory):
80+
(create this as main.tf and run terraform commands from this directory):
9381
```hcl
9482
provider "libvirt" {
9583
uri = "qemu:///system"
@@ -117,11 +105,26 @@ $ terraform destroy
117105

118106
Look at more advanced examples [here](examples/)
119107

108+
## Manual installation
109+
110+
You can also manually download the provider from the [releases section](https://github.com/dmacvicar/terraform-provider-libvirt/releases) on Github. To install it, refer to the [Terraform documentation](https://www.terraform.io/docs/cli/config/config-file.html#provider-installation).
111+
112+
## Building from source
113+
114+
- [Go](https://golang.org/doc/install) is required for building.
115+
116+
```
117+
git clone https://github.com/dmacvicar/terraform-provider-libvirt.git
118+
cd terraform-provider-libvirt
119+
make
120+
```
121+
122+
The binary will be called `terraform-provider-libvirt`.
123+
120124
### Using multiple hypervisors / provider instances
121125

122126
You can target different libvirt hosts instantiating the [provider multiple times](https://www.terraform.io/docs/configuration/providers.html#multiple-provider-instances). [Example](examples/v0.12/multiple).
123127

124-
125128
### Using qemu-agent
126129

127130
From its documentation, [qemu-agent](https://wiki.libvirt.org/page/Qemu_guest_agent):

0 commit comments

Comments
 (0)