diff --git a/README.md b/README.md index 22e69c5..d94ec45 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ Ansible doesn't (seem to) support calling the inventory script with parameters, so you can specify the path to the state file using the `TI_TFSTATE` environment variable, like so: - TI_TFSTATE=deploy/terraform.tfstate ansible-playbook --inventory-file=terraform-inventory + TI_TFSTATE=deploy/terraform.tfstate ansible-playbook --inventory-file=terraform-inventory deploy/playbook.yml Alternately, you can create a little shell script and call that. Something like: diff --git a/fixtures/example.tf b/fixtures/example.tf index b2fa2e0..771ed67 100644 --- a/fixtures/example.tf +++ b/fixtures/example.tf @@ -14,12 +14,14 @@ provider "digitalocean" { } resource "aws_instance" "web-aws" { - ami = "ami-96a818fe" - instance_type = "t2.micro" - subnet_id = "${var.aws_subnet_id}" - root_block_device = { - delete_on_termination = true - } + ami = "ami-96a818fe" + instance_type = "t2.micro" + subnet_id = "${var.aws_subnet_id}" + associate_public_ip_address = true + key_name = "terraform-inventory" + root_block_device = { + delete_on_termination = true + } } resource "digitalocean_droplet" "web-do" { @@ -27,5 +29,5 @@ resource "digitalocean_droplet" "web-do" { name = "terraform-inventory-1" region = "nyc1" size = "512mb" - ssh_keys = [55015] + ssh_keys = [862272] } diff --git a/fixtures/example.tfstate b/fixtures/example.tfstate index e71d37f..4b990f4 100644 --- a/fixtures/example.tfstate +++ b/fixtures/example.tfstate @@ -1,6 +1,6 @@ { "version": 1, - "serial": 11, + "serial": 13, "modules": [ { "path": [ @@ -11,18 +11,21 @@ "aws_instance.web-aws": { "type": "aws_instance", "primary": { - "id": "i-366736e6", + "id": "i-e8f3a238", "attributes": { "ami": "ami-96a818fe", + "associate_public_ip_address": "true", "availability_zone": "us-east-1d", "ebs_block_device.#": "0", "ebs_optimized": "false", "ephemeral_block_device.#": "0", - "id": "i-366736e6", + "id": "i-e8f3a238", "instance_type": "t2.micro", - "private_dns": "ip-10-0-0-4.ec2.internal", - "private_ip": "10.0.0.4", + "key_name": "terraform-inventory", + "private_dns": "ip-10-0-0-12.ec2.internal", + "private_ip": "10.0.0.12", "public_dns": "", + "public_ip": "52.7.58.202", "root_block_device.#": "1", "root_block_device.0.delete_on_termination": "true", "root_block_device.0.iops": "0", @@ -53,7 +56,7 @@ "region": "nyc1", "size": "512mb", "ssh_keys.#": "1", - "ssh_keys.0": "55015", + "ssh_keys.0": "862272", "status": "active" } }