Skip to content

Commit

Permalink
Add support for terraform-provider-libvirt (#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
nixar authored and adammck committed Jun 1, 2018
1 parent dd594d5 commit 1046853
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Expand Up @@ -11,16 +11,17 @@ Terraform, then (re-)provision them with Ansible.
The following providers are supported:

* AWS
* CloudStack
* DigitalOcean
* CloudStack
* DigitalOcean
* Docker
* Exoscale
* Google Compute Engine
* OpenStack
* Google Compute Engine
* [libvirt](https://github.com/dmacvicar/terraform-provider-libvirt)
* OpenStack
* Packet
* Scaleway
* SoftLayer
* VMware
* VMware

It's very simple to add support for new providers. See pull requests with the
[provider][pv] label for examples.
Expand Down
26 changes: 26 additions & 0 deletions parser_test.go
Expand Up @@ -323,6 +323,18 @@ const exampleStateFile = `
},
"deposed": [],
"provider": ""
},
"libvirt_domain.fourteen": {
"type": "libvirt_domain",
"primary": {
"id": "824c29be-2164-44c8-83e0-787705571d95",
"attributes": {
"network_interface.#": "1",
"network_interface.0.addresses.#": "1",
"network_interface.0.addresses.0": "192.168.102.14",
"network_interface.0.mac": "96:EE:4D:BD:B2:45"
}
}
}
}
}
Expand All @@ -346,6 +358,7 @@ const expectedListOutput = `
"10.2.1.5",
"10.20.30.40",
"192.168.0.3",
"192.168.102.14",
"50.0.0.1",
"10.20.30.50"
],
Expand All @@ -370,6 +383,7 @@ const expectedListOutput = `
"eleven": ["10.0.0.11"],
"twelve": ["10.20.30.50"],
"thirteen": ["10.0.0.13"],
"fourteen": ["192.168.102.14"],
"one.0": ["10.0.0.1"],
"dup.0": ["10.0.0.1"],
Expand All @@ -386,6 +400,7 @@ const expectedListOutput = `
"eleven.0": ["10.0.0.11"],
"twelve.0": ["10.20.30.50"],
"thirteen.0": ["10.0.0.13"],
"fourteen.0": ["192.168.102.14"],
"type_aws_instance": ["10.0.0.1", "10.0.1.1", "50.0.0.1"],
"type_digitalocean_droplet": ["192.168.0.3"],
Expand All @@ -398,6 +413,7 @@ const expectedListOutput = `
"type_triton_machine": ["10.0.0.10"],
"type_scaleway_server": ["10.0.0.11"],
"type_packet_device": ["10.0.0.13"],
"type_libvirt_domain": ["192.168.102.14"],
"role_rrrrrrrr": ["10.20.30.40"],
"role_web": ["10.0.0.1"],
Expand All @@ -423,6 +439,7 @@ const expectedInventoryOutput = `[all]
10.2.1.5
10.20.30.40
192.168.0.3
192.168.102.14
50.0.0.1
10.20.30.50
Expand Down Expand Up @@ -465,6 +482,12 @@ olddatacenter="\u003c0.7_format"
[four.0]
10.2.1.5
[fourteen]
192.168.102.14
[fourteen.0]
192.168.102.14
[nine]
10.0.0.9
Expand Down Expand Up @@ -558,6 +581,9 @@ olddatacenter="\u003c0.7_format"
[type_google_compute_instance]
10.0.0.8
[type_libvirt_domain]
192.168.102.14
[type_openstack_compute_instance_v2]
10.120.0.226
Expand Down
1 change: 1 addition & 0 deletions resource.go
Expand Up @@ -32,6 +32,7 @@ func init() {
"ipv4_address_private", // SoftLayer
"networks.0.ip4address", // Exoscale
"primaryip", // Joyent Triton
"network_interface.0.addresses.0", // Libvirt
"network.0.address", // Packet
}

Expand Down

0 comments on commit 1046853

Please sign in to comment.