Recall & Review
beginner
What is the purpose of the
remote-exec provisioner in Terraform?The
remote-exec provisioner runs commands on a remote machine after it is created, allowing you to configure the machine or install software.Click to reveal answer
beginner
Which connection methods can
remote-exec use to connect to the remote machine?It can use SSH for Linux machines or WinRM for Windows machines to connect and run commands remotely.
Click to reveal answer
beginner
How do you specify commands to run with
remote-exec?You specify commands inside the
inline argument as a list of strings, each string is a command to run in order.Click to reveal answer
intermediate
What happens if a command in
remote-exec fails during execution?Terraform stops the provisioning process and reports an error, so you can fix the issue before continuing.
Click to reveal answer
beginner
Why is it important to configure the
connection block correctly when using remote-exec?Because Terraform needs the right credentials and network access to connect to the remote machine and run commands successfully.
Click to reveal answer
What does the
remote-exec provisioner do in Terraform?✗ Incorrect
The remote-exec provisioner runs commands on the remote machine after it is created.
Which protocol is commonly used by
remote-exec to connect to Linux machines?✗ Incorrect
SSH is the standard protocol used to connect to Linux machines remotely.
Where do you list the commands to run in a
remote-exec provisioner?✗ Incorrect
Commands are listed inside the inline block as a list of strings.
What must you configure to allow
remote-exec to connect to the remote machine?✗ Incorrect
The connection block provides the necessary details for Terraform to connect remotely.
If a command in
remote-exec fails, what does Terraform do?✗ Incorrect
Terraform stops the provisioning process and reports the error to prevent further issues.
Explain how the
remote-exec provisioner works in Terraform and why it is useful.Think about how you would set up a new computer remotely after turning it on.
You got /4 concepts.
Describe the role of the
connection block when using remote-exec and what happens if it is misconfigured.Imagine trying to call a friend but dialing the wrong number.
You got /3 concepts.