Complete the code to specify the source file for the file provisioner.
provisioner "file" { source = [1] destination = "/tmp/example.txt" }
The source attribute in the file provisioner specifies the local file path to upload. It must be a local path, like "./localfile.txt".
Complete the code to specify the destination path for the file provisioner.
provisioner "file" { source = "./config.json" destination = [1] }
The destination attribute specifies the path on the remote machine where the file will be copied. It should be an absolute path like "/tmp/config.json".
Fix the error in the file provisioner block by completing the missing attribute.
provisioner "file" { source = "./app.conf" [1] = "/etc/app.conf" }
The correct attribute to specify the remote file path is destination. Other names like path or target are invalid.
Fill both blanks to complete the file provisioner block that uploads a script and sets its permissions.
provisioner "file" { source = [1] destination = [2] } provisioner "remote-exec" { inline = ["chmod +x [2]"] }
The source is the local script file "./deploy.sh". The destination is the remote path "/tmp/deploy.sh". The remote-exec provisioner runs chmod +x on the remote file to make it executable.
Fill all three blanks to create a file provisioner that uploads a config file, sets permissions, and runs a command remotely.
provisioner "file" { source = [1] destination = [2] } provisioner "remote-exec" { inline = ["chmod [3] [2]", "systemctl restart myservice"] }
The source is the local config file "./config.yaml". The destination is the remote path "/etc/myapp/config.yaml". The chmod command uses +x to add execute permissions to the file.