OpenStack support?
adrianlop opened this issue · 6 comments
Hi Adam,
Nice job here.
Will you support Openstack provider anytime soon? I'd appreciate it a lot :)
Thanks in advance.
Regards,
Adrián.
I'd love to support OpenStack, but I have no idea how it works. I could guess based on the docs, but it would be better to work from actual examples. Could you provide a state file with at least one (redacted) openstack_compute_instance_v2
resource?
Sure, here you go (sorry for the delay):
Resource definition:
resource "openstack_compute_instance_v2" "cassandra" {
count = 2
name = "cassandra${format("%02d", count.index+1)}"
image_name = "${var.image_name}"
region = "${var.region}"
flavor_name = "${var.flavor_name_cassandra}"
#floating_ip = "${openstack_networking_floatingip_v2.floatip_1.address}"
network {
uuid = "${var.network_id}"
}
metadata {
ssh_user = "ubuntu"
ansible_group = "cassandra-nodes"
}
key_pair = "${var.openstack_key_pair}"
security_groups = ["${var.security_group}"]
}
Resulting tfstate:
"resources": {
"openstack_compute_instance_v2.cassandra-node.0": {
"type": "openstack_compute_instance_v2",
"primary": {
"id": "1234b77-eb5e-4b5b-a4c2-da6ce31aad97",
"attributes": {
"access_ip_v4": "10.120.0.226",
"access_ip_v6": "",
"flavor_id": "e23157e-f707-4644-b598-0455328d46f1",
"flavor_name": "m1.medium",
"id": "xxfd1b77-eb5e-4b5b-a4c2-da6ce31aad97",
"image_id": "331deee5-95fa-401c-b1b8-5f433b59d97f",
"image_name": "Ubuntu 14.04",
"key_pair": "test",
"metadata.#": "2",
"metadata.ansible_group": "cassandra-nodes",
"metadata.ssh_user": "ubuntu",
"name": "cassandra-node01",
"network.#": "1",
"network.0.fixed_ip_v4": "10.120.0.226",
"network.0.fixed_ip_v6": "",
"network.0.mac": "fa:16:3e:ca:53:43",
"network.0.name": "demo-net",
"network.0.port": "",
"network.0.uuid": "edca5d6a-596b-4996-8f6d-20a415edebbf",
"region": "regionOne",
"security_groups.#": "1",
"security_groups.0": "LAN"
}
}
},
"openstack_compute_instance_v2.cassandra-node.1": {
"type": "openstack_compute_instance_v2",
"primary": {
"id": "2669d6b-f02a-4c5e-9483-a2b2bb50eac7",
"attributes": {
"access_ip_v4": "10.120.0.229",
"access_ip_v6": "",
"flavor_id": "953rf57e-f707-4644-b598-0455328d46f1",
"flavor_name": "m1.medium",
"id": "24zxcd6b-f02a-4c5e-9483-a2b2bb50eac7",
"image_id": "98frtye5-95fa-401c-b1b8-5f433b59d97f",
"image_name": "Ubuntu 14.04",
"key_pair": "terraform-test",
"metadata.#": "2",
"metadata.ansible_group": "cassandra-nodes",
"metadata.ssh_user": "ubuntu",
"name": "cassandra-node02",
"network.#": "1",
"network.0.fixed_ip_v4": "10.120.0.229",
"network.0.fixed_ip_v6": "",
"network.0.mac": "fa:16:3e:fc:05:7b",
"network.0.name": "demo-net",
"network.0.port": "",
"network.0.uuid": "11111d6a-596b-4996-8f6d-20a415edebbf",
"region": "regionOne",
"security_groups.#": "1",
"security_groups.0": "LAN"
}
}
}
}
Thanks in advance! If you need anything else please tell me.
This minor tweak works for me.
Hi there,
I'm planning to use terraform-inventory in a pretty ambitious open source project that's able to deploy to many different cloud providers.
I'm running into a few issues, such as openstack not being supported.
Here's my openstack state:
$ cat .frey/state/terraform.tfstate
{
"version": 1,
"serial": 20,
"modules": [
{
"path": [
"root"
],
"outputs": {},
"resources": {
"openstack_compute_instance_v2.freytest-server-1": {
"type": "openstack_compute_instance_v2",
"depends_on": [
"openstack_compute_secgroup_v2.freytest-secgroup-1"
],
"primary": {
"id": "54d0877f-2382-4372-9325-f193c4257be3",
"attributes": {
"access_ip_v4": "",
"access_ip_v6": "",
"flavor_id": "3",
"flavor_name": "m1.medium",
"id": "54d0877f-2382-4372-9325-f193c4257be3",
"image_id": "cb6b7936-d2c5-4901-8678-c88b3a6ed84c",
"image_name": "ubuntu14.04-LTS",
"key_pair": "freytest-keypair-1",
"metadata.#": "1",
"metadata.frey": "yes please",
"name": "freytest-server-1",
"network.#": "1",
"security_groups.#": "0"
}
}
},
"openstack_compute_keypair_v2.freytest-keypair-1": {
"type": "openstack_compute_keypair_v2",
"primary": {
"id": "freytest-keypair-1",
"attributes": {
"id": "freytest-keypair-1",
"name": "freytest-keypair-1",
"public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDe33HmuH6x/JLVJAkPg9EYHCdFoILCMJefBzIIWJ0BKlTfZPHHndFhyKFA7PStMiwntkd1XcqP5kL2VyJXHB6gMNHcqQ4XBEK8hDdESK3r1Gp4YP2RzqO5KEaQzjw0zrEr8dWm8kzAjhlkqq89sAFA+FC833wdW5NCGT+aQWKhdcJVhl89ppfPgJVXpeQ5ZuGWvOdxJM3h1V0GL8I+0NFb7MuOEneGezth1VIOL+eJJeAMzBWcXO6cAWZG31JkCuNpOG9vDhjYPim+tsozTdRg6g7R0Fmikxw3c3PFEOVKSmDXbOKLVTaXCYvDR0wOM+cLFOzSPl7Dt4aAMBT2h1xL kvz@openstack.freyproject.io\n"
}
}
},
"openstack_compute_secgroup_v2.freytest-secgroup-1": {
"type": "openstack_compute_secgroup_v2",
"primary": {
"id": "84083f80-7464-4cb7-9c06-3255d3e04a93",
"attributes": {
"description": "freytest-secgroup-1",
"id": "84083f80-7464-4cb7-9c06-3255d3e04a93",
"name": "freytest-secgroup-1",
"rule.#": "2",
"rule.0.cidr": "0.0.0.0/0",
"rule.0.from_group_id": "",
"rule.0.from_port": "22",
"rule.0.id": "",
"rule.0.ip_protocol": "tcp",
"rule.0.self": "false",
"rule.0.to_port": "22",
"rule.1.cidr": "0.0.0.0/0",
"rule.1.from_group_id": "",
"rule.1.from_port": "80",
"rule.1.id": "",
"rule.1.ip_protocol": "tcp",
"rule.1.self": "false",
"rule.1.to_port": "80"
}
}
}
}
}
]
}
Feel free to use it, it's as vanilla as can be and does not contain any data that should be private (the account used is a throw-away one from trystack.org, the keys are freshly generated just now)
@kvz Thanks very much for submitting your statefile. But I don't see any IP addresses in it. Were those redacted? My understanding is that the access_ip_v4
attr is expected to contain it.
I just tested with 0.6-pre
and confirmed this is working for me too 💯
Nice find about access_ip_v4
, I had an unrelated misconfigured network section - sorry for posting corrupt states :)