1
1
mirror of https://github.com/adammck/terraform-inventory synced 2024-11-26 07:43:46 +01:00

Add Packet support (#89)

This commit is contained in:
Ned McClain 2018-06-01 08:08:22 -06:00 committed by Adam Mckaig
parent 1795be7398
commit dd594d5811
3 changed files with 47 additions and 0 deletions

@ -17,6 +17,7 @@ The following providers are supported:
* Exoscale * Exoscale
* Google Compute Engine * Google Compute Engine
* OpenStack * OpenStack
* Packet
* Scaleway * Scaleway
* SoftLayer * SoftLayer
* VMware * VMware

@ -292,6 +292,37 @@ const exampleStateFile = `
"default_ip_address": "10.20.30.50" "default_ip_address": "10.20.30.50"
} }
} }
},
"packet_device.thirteen": {
"type": "packet_device",
"depends_on": [],
"primary": {
"id": "e35816e2-b9b4-4ef3-9317-a32b98f6cb44",
"attributes": {
"billing_cycle": "hourly",
"created": "2018-04-02T14:52:34Z",
"facility": "ewr1",
"hostname": "sa-test-1",
"id": "e35816e2-b9b4-4ef3-9317-a32b98f6cb44",
"locked": "false",
"network.#": "3",
"network.0.address": "10.0.0.13",
"network.0.cidr": "31",
"network.0.family": "4",
"network.0.gateway": "10.0.0.254",
"network.0.public": "true",
"operating_system": "ubuntu_16_04",
"plan": "baremetal_0",
"project_id": "123456d5-087a-4976-877a-45b86584b786",
"state": "active",
"tags.#": "0",
"updated": "2018-04-02T14:57:13Z"
},
"meta": {},
"tainted": false
},
"deposed": [],
"provider": ""
} }
} }
} }
@ -306,6 +337,7 @@ const expectedListOutput = `
"10.0.0.1", "10.0.0.1",
"10.0.0.10", "10.0.0.10",
"10.0.0.11", "10.0.0.11",
"10.0.0.13",
"10.0.0.7", "10.0.0.7",
"10.0.0.8", "10.0.0.8",
"10.0.0.9", "10.0.0.9",
@ -337,6 +369,7 @@ const expectedListOutput = `
"ten": ["10.0.0.10"], "ten": ["10.0.0.10"],
"eleven": ["10.0.0.11"], "eleven": ["10.0.0.11"],
"twelve": ["10.20.30.50"], "twelve": ["10.20.30.50"],
"thirteen": ["10.0.0.13"],
"one.0": ["10.0.0.1"], "one.0": ["10.0.0.1"],
"dup.0": ["10.0.0.1"], "dup.0": ["10.0.0.1"],
@ -352,6 +385,7 @@ const expectedListOutput = `
"ten.0": ["10.0.0.10"], "ten.0": ["10.0.0.10"],
"eleven.0": ["10.0.0.11"], "eleven.0": ["10.0.0.11"],
"twelve.0": ["10.20.30.50"], "twelve.0": ["10.20.30.50"],
"thirteen.0": ["10.0.0.13"],
"type_aws_instance": ["10.0.0.1", "10.0.1.1", "50.0.0.1"], "type_aws_instance": ["10.0.0.1", "10.0.1.1", "50.0.0.1"],
"type_digitalocean_droplet": ["192.168.0.3"], "type_digitalocean_droplet": ["192.168.0.3"],
@ -363,6 +397,7 @@ const expectedListOutput = `
"type_google_compute_instance": ["10.0.0.8"], "type_google_compute_instance": ["10.0.0.8"],
"type_triton_machine": ["10.0.0.10"], "type_triton_machine": ["10.0.0.10"],
"type_scaleway_server": ["10.0.0.11"], "type_scaleway_server": ["10.0.0.11"],
"type_packet_device": ["10.0.0.13"],
"role_rrrrrrrr": ["10.20.30.40"], "role_rrrrrrrr": ["10.20.30.40"],
"role_web": ["10.0.0.1"], "role_web": ["10.0.0.1"],
@ -379,6 +414,7 @@ const expectedInventoryOutput = `[all]
10.0.0.1 10.0.0.1
10.0.0.10 10.0.0.10
10.0.0.11 10.0.0.11
10.0.0.13
10.0.0.7 10.0.0.7
10.0.0.8 10.0.0.8
10.0.0.9 10.0.0.9
@ -481,6 +517,12 @@ olddatacenter="\u003c0.7_format"
[ten.0] [ten.0]
10.0.0.10 10.0.0.10
[thirteen]
10.0.0.13
[thirteen.0]
10.0.0.13
[three] [three]
192.168.0.3 192.168.0.3
@ -519,6 +561,9 @@ olddatacenter="\u003c0.7_format"
[type_openstack_compute_instance_v2] [type_openstack_compute_instance_v2]
10.120.0.226 10.120.0.226
[type_packet_device]
10.0.0.13
[type_scaleway_server] [type_scaleway_server]
10.0.0.11 10.0.0.11

@ -32,6 +32,7 @@ func init() {
"ipv4_address_private", // SoftLayer "ipv4_address_private", // SoftLayer
"networks.0.ip4address", // Exoscale "networks.0.ip4address", // Exoscale
"primaryip", // Joyent Triton "primaryip", // Joyent Triton
"network.0.address", // Packet
} }
// type.name.0 // type.name.0