radekg / terraform-provisioner-ansible

Ansible with Terraform 0.14.x
Apache License 2.0
572 stars 100 forks source link

[WIP] Add support of Terraform v0.12 #126

Closed cryptobioz closed 5 years ago

radekg commented 5 years ago

Hi @cryptobioz. Thank you! Definitely. Please let me get the https://github.com/radekg/terraform-provisioner-ansible/pull/124 in and I'll be on this before the end of the weekend. I should properly plan for future 0.11.x updates.

nicholasamorim commented 5 years ago

How is this looking? I see #124 has been merged.

alexkreidler commented 5 years ago

We're all waiting on this!!

We love this project, but we need support for terraform 0.12. Thanks!

systembell commented 5 years ago

@alexkreidler I second it. I've got it working in 0.12 with @ivandeex's release on his fork in the meantime. Works perfectly.

ivandeex commented 5 years ago

This patch makes the plugin work in 0.12 but breaks compatibility with 0.11, because validation function works directly with internal packer structures. I made a better patch, which uses packer API instead. The patched plugin is compatible with both pre- and post-0.12 packer versions. Unfortunately I was too busy to submit last week.

systembell commented 5 years ago

I didn't have any issues @ivandeex because I'd converted everything to 0.12. Thanks a ton for your releases!

jakubgs commented 5 years ago

Holy Vendor Batman! 8267 files changed... This is why God invented lock files like go.mod and go.sum on the 8th day. Thanks a bunch for your work!

jakubgs commented 5 years ago

How do I build this? I've cloned your repo but when i run make build-linux I'm getting:

./bin/check-golang-version.sh
mkdir -p ~/.terraform.d/plugins
CGO_ENABLED=0 GOOS=linux installsuffix=cgo go build -o ./terraform-provisioner-ansible-linux
# _/home/sochan/soft/terraform-provisioner-ansible-fixed
./resource_provisioner.go:25:4: cannot use types.NewPlaySchema() (type *"github.com/radekg/terraform-provisioner-ansible/vendor/github.com/hashicorp/terraform/helper/schema".Schema) as type *"github.com/hashicorp/terraform/helper/schema".Schema in map value
./resource_provisioner.go:26:4: cannot use types.NewDefaultsSchema() (type *"github.com/radekg/terraform-provisioner-ansible/vendor/github.com/hashicorp/terraform/helper/schema".Schema) as type *"github.com/hashicorp/terraform/helper/schema".Schema in map value
./resource_provisioner.go:27:4: cannot use types.NewRemoteSchema() (type *"github.com/radekg/terraform-provisioner-ansible/vendor/github.com/hashicorp/terraform/helper/schema".Schema) as type *"github.com/hashicorp/terraform/helper/schema".Schema in map value
./resource_provisioner.go:28:4: cannot use types.NewAnsibleSSHSettingsSchema() (type *"github.com/radekg/terraform-provisioner-ansible/vendor/github.com/hashicorp/terraform/helper/schema".Schema) as type *"github.com/hashicorp/terraform/helper/schema".Schema in map value
./resource_provisioner.go:107:40: cannot use s (type *"github.com/hashicorp/terraform/terraform".InstanceState) as type *"github.com/radekg/terraform-provisioner-ansible/vendor/github.com/hashicorp/terraform/terraform".InstanceState in argument to mode.NewRemoteMode
./resource_provisioner.go:115:37: cannot use s (type *"github.com/hashicorp/terraform/terraform".InstanceState) as type *"github.com/radekg/terraform-provisioner-ansible/vendor/github.com/hashicorp/terraform/terraform".InstanceState in argument to mode.NewLocalMode
make: *** [Makefile:43: build-linux] Error 2
radekg commented 5 years ago

PR https://github.com/radekg/terraform-provisioner-ansible/pull/129 replaces this one. https://github.com/radekg/terraform-provisioner-ansible/pull/129 upgrades Terraform to 0.12.5, fixes tests, updates examples to work with Terraform 0.12.x.