Terraform: Ignoring files when copying with file provisioner

Created on 14 Mar 2016  路  4Comments  路  Source: hashicorp/terraform

I'm copying a directory (and subdirectories) to a remote machine with the file provisioner, but would like to skip some of the files in it. I wonder if there is currently a way (explicit) to ignore files when copying with the file provisioner, or do I need to delete them afterwards with a remote-exec block?

Possibly related with #1948

provisionefile question

All 4 comments

Rather than add this to the file provisioner, we recomend you work around this at the moment using local-exec to filter the files into a new directory then upload. This isn't ideal but is a solid workaround.

Thanks for the hint, will try that solution. It feels cleaner than deleting them on the remote machine.

Introduce .tfignore just like .gitignore ? 馃榿

@gaui idea sounds amazing

Was this page helpful?
0 / 5 - 0 ratings