terraform { required_providers { random = { source = "hashicorp/random" version = "~> 3.6" } local = { source = "hashicorp/local" version = "~> 2.5" } vagrant = { source = "bmatcuk/vagrant" version = "~> 4.0" } } } locals { vagrantfile_hash = filemd5("${path.module}/Vagrantfile") provisioning_files = sort(concat( [for file in fileset("${path.module}/ansible", "**") : "ansible/${file}"], [for file in fileset("${path.module}/sql", "**") : "sql/${file}"], )) provisioning_hash = sha256(join("", [ for file in local.provisioning_files : filesha256("${path.module}/${file}") ])) } resource "random_password" "mysql" { length = 16 special = false } resource "local_file" "ansible_vars" { filename = "${path.module}/ansible/group_vars/all.yml" content = <