1
1
mirror of https://github.com/adammck/terraform-inventory synced 2024-11-22 15:52:01 +01:00

Add support for terraform-provider-libvirt (#90)

See: https://github.com/dmacvicar/terraform-provider-libvirt
This commit is contained in:
nixar 2018-06-01 16:45:50 +02:00 committed by Adam Mckaig
parent dd594d5811
commit 1046853480
3 changed files with 33 additions and 5 deletions

@ -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.

@ -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"
}
}
}
}
}
@ -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"
],
@ -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"],
@ -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"],
@ -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"],
@ -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
@ -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
@ -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

@ -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
}