Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showing Terraform outputs as "global" variables #30

Merged
merged 7 commits into from
Apr 9, 2016

Conversation

lazartravica
Copy link
Contributor

Outputs specified in the Terraform file are passed to the Ansible dynamic inventory JSON accessible to all hosts.

@adammck
Copy link
Owner

adammck commented Feb 18, 2016

Good idea, thanks for submitting this. Would you mind adding a test case to parser_test.go? (I know it's strange that all of the tests are in there; I intend to split them up.) I'd like to be sure that I understand what's going on here.

@adammck adammck mentioned this pull request Mar 1, 2016
@lazartravica
Copy link
Contributor Author

Hey @adammck , I've commited the parser test.

@lazartravica
Copy link
Contributor Author

@adammck Fixed the compatibility issue with the #31, able to merge 👍

@adammck
Copy link
Owner

adammck commented Apr 9, 2016

Looks good to me:

adammck@imac5k [git df49397] 
~/code/src/github.com/lazartravica/terraform-inventory$ TF_STATE=fixtures/example.tfstate terraform-inventory --list | jq .
{
  "all": {
    "datacenter": "mydc"
  },
  "alpha": [
    "52.90.134.71",
    "52.90.154.150"
  ],
  "alpha.0": [
    "52.90.134.71"
  ],
  "alpha.1": [
    "52.90.154.150"
  ],
  "beta": [
    "52.23.224.202"
  ],
  "beta.0": [
    "52.23.224.202"
  ],
  "gamma": [
    "198.211.99.194"
  ],
  "gamma.0": [
    "198.211.99.194"
  ],
  "role_web": [
    "52.90.134.71",
    "52.90.154.150"
  ],
  "role_worker": [
    "52.23.224.202"
  ],
  "type_aws_instance": [
    "52.90.134.71",
    "52.90.154.150",
    "52.23.224.202"
  ],
  "type_digitalocean_droplet": [
    "198.211.99.194"
  ]
}

This is fantastic, thank you!

@adammck adammck merged commit 9debcb4 into adammck:master Apr 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants