job "nfs-storage-test" {
  datacenters = ["dc1"]
  type = "batch"

  group "test" {
    count = 1

    volume "nfs-storage" {
      type      = "csi"
      read_only = false
      source    = "nfs-fnsync"
    }

    task "storage-test" {
      driver = "exec"

      volume_mount {
        volume      = "nfs-storage"
        destination = "/mnt/nfs"
        read_only   = false
      }

      config {
        command = "/bin/sh"
        args    = ["-c", "echo 'NFS Storage Test - $(hostname) - $(date)' > /mnt/nfs/test-$(hostname).txt && ls -la /mnt/nfs/"]
      }

      resources {
        cpu    = 50
        memory = 64
      }
    }
  }
}