Skip to content

Commit 842b8f7

Browse files
cgroschuppadammck
authored andcommitted
Add support for ProfitBricks (#93)
1 parent 1046853 commit 842b8f7

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ The following providers are supported:
1919
* [libvirt](https://github.com/dmacvicar/terraform-provider-libvirt)
2020
* OpenStack
2121
* Packet
22+
* ProfitBricks
2223
* Scaleway
2324
* SoftLayer
2425
* VMware

parser_test.go

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,15 @@ const exampleStateFile = `
335335
"network_interface.0.mac": "96:EE:4D:BD:B2:45"
336336
}
337337
}
338+
},
339+
"profitbricks_server.sixteen": {
340+
"type": "profitbricks_server",
341+
"primary": {
342+
"id": "12345678",
343+
"attributes": {
344+
"primary_ip": "10.0.0.16"
345+
}
346+
}
338347
}
339348
}
340349
}
@@ -350,6 +359,7 @@ const expectedListOutput = `
350359
"10.0.0.10",
351360
"10.0.0.11",
352361
"10.0.0.13",
362+
"10.0.0.16",
353363
"10.0.0.7",
354364
"10.0.0.8",
355365
"10.0.0.9",
@@ -384,6 +394,7 @@ const expectedListOutput = `
384394
"twelve": ["10.20.30.50"],
385395
"thirteen": ["10.0.0.13"],
386396
"fourteen": ["192.168.102.14"],
397+
"sixteen": ["10.0.0.16"],
387398
388399
"one.0": ["10.0.0.1"],
389400
"dup.0": ["10.0.0.1"],
@@ -401,12 +412,14 @@ const expectedListOutput = `
401412
"twelve.0": ["10.20.30.50"],
402413
"thirteen.0": ["10.0.0.13"],
403414
"fourteen.0": ["192.168.102.14"],
415+
"sixteen.0": ["10.0.0.16"],
404416
405417
"type_aws_instance": ["10.0.0.1", "10.0.1.1", "50.0.0.1"],
406418
"type_digitalocean_droplet": ["192.168.0.3"],
407419
"type_cloudstack_instance": ["10.2.1.5"],
408420
"type_vsphere_virtual_machine": ["10.20.30.40", "10.20.30.50"],
409421
"type_openstack_compute_instance_v2": ["10.120.0.226"],
422+
"type_profitbricks_server": ["10.0.0.16"],
410423
"type_softlayer_virtual_guest": ["10.0.0.7"],
411424
"type_exoscale_compute": ["10.0.0.9"],
412425
"type_google_compute_instance": ["10.0.0.8"],
@@ -431,6 +444,7 @@ const expectedInventoryOutput = `[all]
431444
10.0.0.10
432445
10.0.0.11
433446
10.0.0.13
447+
10.0.0.16
434448
10.0.0.7
435449
10.0.0.8
436450
10.0.0.9
@@ -528,6 +542,12 @@ olddatacenter="\u003c0.7_format"
528542
[six.0]
529543
10.120.0.226
530544
545+
[sixteen]
546+
10.0.0.16
547+
548+
[sixteen.0]
549+
10.0.0.16
550+
531551
[staging]
532552
192.168.0.3
533553
@@ -590,6 +610,9 @@ olddatacenter="\u003c0.7_format"
590610
[type_packet_device]
591611
10.0.0.13
592612
613+
[type_profitbricks_server]
614+
10.0.0.16
615+
593616
[type_scaleway_server]
594617
10.0.0.11
595618

resource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func init() {
3434
"primaryip", // Joyent Triton
3535
"network_interface.0.addresses.0", // Libvirt
3636
"network.0.address", // Packet
37+
"primary_ip", // Profitbricks
3738
}
3839

3940
// type.name.0

0 commit comments

Comments
 (0)