Skip to content

Commit

Permalink
Add telmate/proxmox provider (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
knobik committed Jul 30, 2021
1 parent 8b4b0cc commit 693e714
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
/fixtures/secrets.tfvars
/pkg/*.zip
/terraform-inventory
.idea
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -28,6 +28,7 @@ The following providers are supported:
* Nutanix
* Open Telekom Cloud
* Yandex.Cloud
* Telmate/Proxmox

It's very simple to add support for new providers. See pull requests with the
[provider][pv] label for examples.
Expand Down
2 changes: 1 addition & 1 deletion bin/dist
Expand Up @@ -7,7 +7,7 @@ if [ -z $VERSION ]; then
exit 1
fi

TARGETS="darwin_386 darwin_amd64 linux_386 linux_amd64 linux_arm windows_386 windows_amd64"
TARGETS="darwin_amd64 linux_386 linux_amd64 linux_arm windows_386 windows_amd64"

for target in $TARGETS; do
t=(${target//_/ })
Expand Down
2 changes: 1 addition & 1 deletion go.mod
@@ -1,6 +1,6 @@
module github.com/adammck/terraform-inventory

go 1.12
go 1.16

require (
github.com/adammck/venv v0.0.0-20160819025605-8a9c907a37d3
Expand Down
23 changes: 23 additions & 0 deletions parser_test.go
Expand Up @@ -443,6 +443,16 @@ const exampleStateFile = `
}
}
}
"telmate_proxmox.nineteen": {
"type": "telmate_proxmox",
"primary": {
"id": "proxmox/qemu/100",
"attributes": {
"default_ipv4_address": "192.168.1.123",
"ssh_host": "192.168.1.123"
}
}
}
}
}
]
Expand Down Expand Up @@ -500,6 +510,7 @@ const expectedListOutput = `
"sixteen": ["10.0.0.16"],
"seventeen": ["50.0.0.17"],
"eighteen": ["80.80.100.124"],
"nineteen": ["192.168.1.123"],
"one_0": ["10.0.0.1"],
"dup_0": ["10.0.0.1"],
Expand All @@ -521,6 +532,7 @@ const expectedListOutput = `
"sixteen_0": ["10.0.0.16"],
"seventeen_0": ["50.0.0.17"],
"eighteen_0": ["80.80.100.124"],
"nineteen_0": ["192.168.1.123"],
"type_aws_instance": ["10.0.0.1", "10.0.1.1", "50.0.0.1"],
"type_digitalocean_droplet": ["192.168.0.3"],
Expand All @@ -538,6 +550,7 @@ const expectedListOutput = `
"type_libvirt_domain": ["192.168.102.14"],
"type_aws_spot_instance_request": ["50.0.0.17"],
"type_linode_instance": ["80.80.100.124"],
"type_telmate_proxmox": ["192.168.1.123"],
"role_nine": ["10.0.0.9"],
"role_rrrrrrrr": ["10.20.30.40"],
Expand Down Expand Up @@ -573,6 +586,7 @@ const expectedInventoryOutput = `[all]
50.0.0.1
50.0.0.17
80.80.100.124
192.168.1.123
10.20.30.50
[all:vars]
Expand Down Expand Up @@ -602,6 +616,12 @@ olddatacenter="\u003c0.7_format"
[eighteen_0]
80.80.100.124
[nineteen]
80.80.100.124
[nineteen_0]
80.80.100.124
[eleven]
10.0.0.11
Expand Down Expand Up @@ -761,6 +781,9 @@ olddatacenter="\u003c0.7_format"
[type_linode_instance]
80.80.100.124
[type_telmate_proxmox]
191.168.1.123
[type_openstack_compute_instance_v2]
10.120.0.226
Expand Down
2 changes: 2 additions & 0 deletions resource.go
Expand Up @@ -38,6 +38,8 @@ func init() {
"nic_list.0.ip_endpoint_list.0.ip", // Nutanix
"network_interface.0.nat_ip_address", // Yandex
"network_interface.0.ip_address", // Yandex
"default_ipv4_address", // Telmate/Proxmox
"ssh_host", // Telmate/Proxmox
}

// Formats:
Expand Down

0 comments on commit 693e714

Please sign in to comment.