Skip to content

Commit 78421f2

Browse files
authored
Merge pull request dmacvicar#610 from tripledes/terraform_012
doc: more updates for 0.12 syntx
2 parents 1f39118 + fe2a2a4 commit 78421f2

File tree

6 files changed

+57
-57
lines changed

6 files changed

+57
-57
lines changed

website/docs/r/cloudinit.html.markdown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ used to customize a domain during first boot.
1515

1616
```hcl
1717
resource "libvirt_cloudinit_disk" "commoninit" {
18-
name = "commoninit.iso"
19-
user_data = "${data.template_file.user_data.rendered}"
18+
name = "commoninit.iso"
19+
user_data = data.template_file.user_data.rendered
2020
}
2121
2222
data "template_file" "user_data" {
23-
template = "${file("${path.module}/cloud_init.cfg")}"
23+
template = file("${path.module}/cloud_init.cfg")
2424
}
2525
2626
```
@@ -36,7 +36,7 @@ chpasswd:
3636
```
3737

3838
In this example we change with help of cloud-init the root pwd.
39-
Take also insipiration from ubuntu.tf https://github.com/dmacvicar/terraform-provider-libvirt/blob/master/examples/ubuntu/ubuntu-example.tf
39+
Take also insipiration from ubuntu.tf https://github.com/dmacvicar/terraform-provider-libvirt/blob/master/examples/v0.12/ubuntu/ubuntu-example.tf
4040

4141
## Argument Reference
4242

website/docs/r/coreos_ignition.html.markdown

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ data "ignition_systemd_unit" "example" {
5656
# Ignition config include the previous defined systemd unit data source
5757
data "ignition_config" "example" {
5858
systemd = [
59-
"${data.ignition_systemd_unit.example.id}",
59+
"data.ignition_systemd_unit.example.id",
6060
]
6161
}
6262
6363
resource "libvirt_ignition" "ignition" {
6464
name = "ignition"
65-
content = "${data.ignition_config.example.rendered}"
65+
content = data.ignition_config.example.rendered
6666
}
6767
6868
resource "libvirt_domain" "my_machine" {
69-
coreos_ignition = "${libvirt_ignition.ignition.id}"
69+
coreos_ignition = libvirt_ignition.ignition.id
7070
...
7171
}
7272
```

website/docs/r/domain.html.markdown

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@ Given that you can define a volume from a remote http file, this means, you can
7171
```hcl
7272
resource "libvirt_volume" "kernel" {
7373
source = "http://download.opensuse.org/tumbleweed/repo/oss/boot/x86_64/loader/linux"
74-
name = "kernel"
75-
pool = "default"
74+
name = "kernel"
75+
pool = "default"
7676
format = "raw"
7777
}
7878
7979
resource "libvirt_domain" "domain-suse" {
80-
name = "suse"
80+
name = "suse"
8181
memory = "1024"
82-
vcpu = 1
82+
vcpu = 1
8383
84-
kernel = "${libvirt_volume.kernel.id}"
84+
kernel = libvirt_volume.kernel.id
8585
8686
// ...
8787
}
@@ -95,11 +95,11 @@ You can use it in the same way as the kernel.
9595

9696
```hcl
9797
resource "libvirt_domain" "domain-suse" {
98-
name = "suse"
98+
name = "suse"
9999
memory = "1024"
100-
vcpu = 1
100+
vcpu = 1
101101
102-
kernel = "${libvirt_volume.kernel.id}"
102+
kernel = libvirt_volume.kernel.id
103103
104104
cmdline = [
105105
{
@@ -168,12 +168,12 @@ So you should typically use the firmware as this,
168168

169169
```hcl
170170
resource "libvirt_domain" "my_machine" {
171-
name = "my_machine"
171+
name = "my_machine"
172172
firmware = "/usr/share/qemu/ovmf-x86_64-code.bin"
173-
memory = "2048"
173+
memory = "2048"
174174
175175
disk {
176-
volume_id = "${libvirt_volume.volume.id}"
176+
volume_id = libvirt_volume.volume.id
177177
}
178178
...
179179
}
@@ -192,15 +192,15 @@ look like this:
192192

193193
```hcl
194194
resource "libvirt_domain" "my_machine" {
195-
name = "my_machine"
195+
name = "my_machine"
196196
firmware = "/usr/share/qemu/ovmf-x86_64-code.bin"
197197
nvram {
198198
file = "/usr/local/share/qemu/custom-vars.bin"
199199
}
200200
memory = "2048"
201201
202202
disk {
203-
volume_id = "${libvirt_volume.volume.id}"
203+
volume_id = libvirt_volume.volume.id
204204
}
205205
...
206206
}
@@ -212,7 +212,7 @@ coming from a template, the domain definition should look like this:
212212

213213
```hcl
214214
resource "libvirt_domain" "my_machine" {
215-
name = "my_machine"
215+
name = "my_machine"
216216
firmware = "/usr/share/qemu/ovmf-x86_64-code.bin"
217217
nvram {
218218
file = "/usr/local/share/qemu/custom-vars.bin"
@@ -221,7 +221,7 @@ resource "libvirt_domain" "my_machine" {
221221
memory = "2048"
222222
223223
disk {
224-
volume_id = "${libvirt_volume.volume.id}"
224+
volume_id = libvirt_volume.volume.id
225225
}
226226
...
227227
}
@@ -245,20 +245,20 @@ a scsi controller, if not specified then a random wwn is generated for the disk
245245

246246
```hcl
247247
resource "libvirt_volume" "leap" {
248-
name = "leap"
248+
name = "leap"
249249
source = "http://someurl/openSUSE_Leap-42.1.qcow2"
250250
}
251251
252252
resource "libvirt_volume" "mydisk" {
253-
name = "mydisk"
254-
base_volume_id = "${libvirt_volume.leap.id}"
253+
name = "mydisk"
254+
base_volume_id = libvirt_volume.leap.id
255255
}
256256
257257
resource "libvirt_domain" "domain1" {
258258
name = "domain1"
259259
disk {
260-
volume_id = "${libvirt_volume.mydisk.id}"
261-
scsi = "true"
260+
volume_id = libvirt_volume.mydisk.id
261+
scsi = "true"
262262
}
263263
264264
disk {
@@ -279,10 +279,10 @@ the following examples:
279279
resource "libvirt_domain" "my_machine" {
280280
...
281281
disk {
282-
volume_id = "${libvirt_volume.volume1.id}"
282+
volume_id = libvirt_volume.volume1.id
283283
}
284284
disk {
285-
volume_id = "${libvirt_volume.volume2.id}"
285+
volume_id = libvirt_volume.volume2.id
286286
}
287287
}
288288
```
@@ -292,10 +292,10 @@ resource "libvirt_domain" "my_machine" {
292292
...
293293
disk = [
294294
{
295-
volume_id = "${libvirt_volume.volume1.id}"
295+
volume_id = libvirt_volume.volume1.id
296296
},
297297
{
298-
volume_id = "${libvirt_volume.volume2.id}"
298+
volume_id = libvirt_volume.volume2.id
299299
}
300300
]
301301
}
@@ -304,7 +304,7 @@ resource "libvirt_domain" "my_machine" {
304304
```hcl
305305
resource "libvirt_domain" "my_machine" {
306306
...
307-
disk = ["${var.disk_map_list}"]
307+
disk = [var.disk_map_list]
308308
}
309309
```
310310

@@ -319,10 +319,10 @@ resource "libvirt_domain" "domain1" {
319319
name = "domain1"
320320
321321
network_interface {
322-
network_id = "${libvirt_network.net1.id}"
323-
hostname = "master"
324-
addresses = ["10.17.3.3"]
325-
mac = "AA:BB:CC:11:22:22"
322+
network_id = libvirt_network.net1.id
323+
hostname = "master"
324+
addresses = ["10.17.3.3"]
325+
mac = "AA:BB:CC:11:22:22"
326326
wait_for_lease = true
327327
}
328328
}
@@ -408,7 +408,7 @@ The `graphics` block will look as follows:
408408
resource "libvirt_domain" "my_machine" {
409409
...
410410
graphics {
411-
type = "vnc"
411+
type = "vnc"
412412
listen_type = "address"
413413
}
414414
}
@@ -440,7 +440,7 @@ The block looks as follows:
440440
resource "libvirt_domain" "my_machine" {
441441
...
442442
console {
443-
type = "pty"
443+
type = "pty"
444444
target_port = "0"
445445
target_type = <"serial" or "virtio">
446446
source_path = "/dev/pts/4"
@@ -513,13 +513,13 @@ Example:
513513

514514
```hcl
515515
filesystem {
516-
source = "/tmp"
517-
target = "tmp"
516+
source = "/tmp"
517+
target = "tmp"
518518
readonly = false
519519
}
520520
filesystem {
521-
source = "/proc"
522-
target = "proc"
521+
source = "/proc"
522+
target = "proc"
523523
readonly = true
524524
}
525525
```

website/docs/r/network.markdown

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,14 @@ An advanced example of round-robin DNS (using DNS host templates) follows:
138138
resource "libvirt_network" "my_network" {
139139
...
140140
dns = {
141-
hosts { "${flatten(data.libvirt_network_dns_host_template.hosts.*.rendered)}" }
141+
hosts { flatten(data.libvirt_network_dns_host_template.hosts.*.rendered) }
142142
}
143143
...
144144
}
145145
146146
data "libvirt_network_dns_host_template" "hosts" {
147-
count = "${var.host_count}"
148-
ip = "${var.host_ips[count.index]}"
147+
count = var.host_count
148+
ip = var.host_ips[count.index]
149149
hostname = "my_host"
150150
}
151151
```
@@ -154,17 +154,17 @@ An advanced example of setting up multiple SRV records using DNS SRV templates i
154154

155155
```hcl
156156
data "libvirt_network_dns_srv_template" "etcd_cluster" {
157-
count = "${var.etcd_count}"
158-
service = "etcd-server"
157+
count = var.etcd_count
158+
service = "etcd-server"
159159
protocol = "tcp"
160-
domain = "${discovery_domain}"
161-
target = "${var.cluster_name}-etcd-${count.index}.${discovery_domain}"
160+
domain = var.discovery_domain
161+
target = "${var.cluster_name}-etcd-${count.index}.${discovery_domain}"
162162
}
163163
164164
resource "libvirt_network" "k8snet" {
165165
...
166166
dns = [{
167-
srvs = [ "${flatten(data.libvirt_network_dns_srv_template.etcd_cluster.*.rendered)}" ]
167+
srvs = [ flatten(data.libvirt_network_dns_srv_template.etcd_cluster.*.rendered) ]
168168
}]
169169
...
170170
}
@@ -179,7 +179,7 @@ resource "libvirt_network" "k8snet" {
179179
mode = "nat"
180180
domain = "k8s.local"
181181
addresses = ["10.17.3.0/24"]
182-
dhcp {
182+
dhcp = {
183183
enabled = true
184184
}
185185
```

website/docs/r/pool.html.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ resource "libvirt_pool" "cluster" {
2424
}
2525
2626
resource "libvirt_volume" "opensuse_leap" {
27-
name = "opensuse_leap"
28-
pool = "${libvirt_pool.cluster.name}"
27+
name = "opensuse_leap"
28+
pool = libvirt_pool.cluster.name
2929
source = "http://download.opensuse.org/repositories/Cloud:/Images:/Leap_42.1/images/openSUSE-Leap-42.1-OpenStack.x86_64.qcow2"
3030
}
3131
```

website/docs/r/volume.html.markdown

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ Manages a storage volume in libvirt. For more information see
1717
# Base OS image to use to create a cluster of different
1818
# nodes
1919
resource "libvirt_volume" "opensuse_leap" {
20-
name = "opensuse_leap"
20+
name = "opensuse_leap"
2121
source = "http://download.opensuse.org/repositories/Cloud:/Images:/Leap_42.1/images/openSUSE-Leap-42.1-OpenStack.x86_64.qcow2"
2222
}
2323
2424
# volume to attach to the "master" domain as main disk
2525
resource "libvirt_volume" "master" {
2626
name = "master.qcow2"
27-
base_volume_id = "${libvirt_volume.opensuse_leap.id}"
27+
base_volume_id = libvirt_volume.opensuse_leap.id
2828
}
2929
3030
# volumes to attach to the "workers" domains as main disk
3131
resource "libvirt_volume" "worker" {
3232
name = "worker_${count.index}.qcow2"
33-
base_volume_id = "${libvirt_volume.opensuse_leap.id}"
34-
count = "${var.workers_count}"
33+
base_volume_id = libvirt_volume.opensuse_leap.id
34+
count = var.workers_count
3535
}
3636
```
3737

0 commit comments

Comments
 (0)