mantl / terraform.py

Ansible dynamic inventory script for parsing Terraform state files
Apache License 2.0
451 stars 122 forks source link

terraform.py using *.tfstate files outside of working directory (and below) #53

Closed jmvbxx closed 6 years ago

jmvbxx commented 7 years ago

My current working directory is ~/coding/terraform1 which is where I am trying to run my ansible-playbook command using terraform.py.

When the command runs it is three other terraform.tfstate files that are not in the working directory, or below.

For example:

The documentation says that it only reads the state file in the working directory or below. So, am I misreading the documentation or is this undesired behaviour?

Thanks!

tlc commented 7 years ago

I'm very curious about this, too!

There's a line causing this that I've modified in my local copy.

                             # os.path.abspath(os.path.join(os.path.dirname(__file__),
                             #                              '..', '..', )))
                             os.path.abspath(os.getcwd()))
jmvbxx commented 6 years ago

I guess we can close this 18 months later ;-)