Task

resource "task" "manual_installation" {
  prerequisites = []

  config {
    user   = "root"
    target = resource.container.ubuntu
  }

  condition "binary_exists" {
    description = "Terraform installed on path"

    check {
      script          = "scripts/installation/manual_installation/binary_exists"
      failure_message = "terraform binary not found on the PATH"
    }

    solve {
      script  = "scripts/installation/manual_installation/solve"
      
      config {
	timeout = 60
      }
    }
  }

  condition "latest_version" {
    description = "Terraform binary is the latest version"

    check {
      script          = "scripts/installation/manual_installation/version_latest"
      variables       = { 
        name = "terraform" 
      }
      
      failure_message = "terraform binary is not the latest version"
    }
  }
}

Last updated