Skip to content

Commit

Permalink
Merge pull request #26203 from hashicorp/pselle/deprecate-vendor-prov…
Browse files Browse the repository at this point in the history
…isioners

Deprecate vendor (3rd party) provisioners
  • Loading branch information
Pam Selle authored Sep 15, 2020
2 parents b395887 + 5153ea6 commit 81a6cde
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 8 deletions.
10 changes: 10 additions & 0 deletions configs/provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ func decodeProvisionerBlock(block *hcl.Block) (*Provisioner, hcl.Diagnostics) {
content, config, diags := block.Body.PartialContent(provisionerBlockSchema)
pv.Config = config

switch pv.Type {
case "chef", "habitat", "puppet", "salt-masterless":
diags = append(diags, &hcl.Diagnostic{
Severity: hcl.DiagWarning,
Summary: fmt.Sprintf("The \"%s\" provisioner is deprecated", pv.Type),
Detail: fmt.Sprintf("The \"%s\" provisioner is deprecated and will be removed from future versions of Terraform. Visit https://learn.hashicorp.com/collections/terraform/provision for alternatives to using provisioners that are a better fit for the Terraform workflow.", pv.Type),
Subject: &pv.TypeRange,
})
}

if attr, exists := content.Attributes["when"]; exists {
expr, shimDiags := shimTraversalInString(attr.Expr, true)
diags = append(diags, shimDiags...)
Expand Down
3 changes: 3 additions & 0 deletions configs/testdata/warning-files/vendor_provisioners.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
resource "null_resource" "test" {
provisioner "habitat" {} # WARNING: The "habitat" provisioner is deprecated
}
5 changes: 3 additions & 2 deletions website/docs/provisioners/chef.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ The `chef` provisioner installs, configures and runs the Chef Client on a remote
resource. The `chef` provisioner supports both `ssh` and `winrm` type
[connections](/docs/provisioners/connection.html).

-> **Note:** Provisioners should only be used as a last resort. For most
common situations there are better alternatives. For more information, see
-> **Note:** This provisioner has been deprecated as of Terraform 0.13.3 and will be
removed in a future version of Terraform. For most common situations there are better
alternatives to using provisioners. For more information, see
[the main Provisioners page](./).

## Requirements
Expand Down
5 changes: 3 additions & 2 deletions website/docs/provisioners/habitat.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ description: |-

The `habitat` provisioner installs the [Habitat](https://habitat.sh) supervisor and loads configured services. This provisioner only supports Linux targets using the `ssh` connection type at this time.

-> **Note:** Provisioners should only be used as a last resort. For most
common situations there are better alternatives. For more information, see
-> **Note:** This provisioner has been deprecated as of Terraform 0.13.3 and will be
removed in a future version of Terraform. For most common situations there are better
alternatives to using provisioners. For more information, see
[the main Provisioners page](./).

## Requirements
Expand Down
5 changes: 3 additions & 2 deletions website/docs/provisioners/puppet.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ The `puppet` provisioner installs, configures and runs the Puppet agent on a
remote resource. The `puppet` provisioner supports both `ssh` and `winrm` type
[connections](/docs/provisioners/connection.html).

-> **Note:** Provisioners should only be used as a last resort. For most
common situations there are better alternatives. For more information, see
-> **Note:** This provisioner has been deprecated as of Terraform 0.13.3 and will be
removed in a future version of Terraform. For most common situations there are better
alternatives to using provisioners. For more information, see
[the main Provisioners page](./).

## Requirements
Expand Down
5 changes: 3 additions & 2 deletions website/docs/provisioners/salt-masterless.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ Type: `salt-masterless`
The `salt-masterless` Terraform provisioner provisions machines built by Terraform
using [Salt](http://saltstack.com/) states, without connecting to a Salt master. The `salt-masterless` provisioner supports `ssh` [connections](/docs/provisioners/connection.html).

-> **Note:** Provisioners should only be used as a last resort. For most
common situations there are better alternatives. For more information, see
-> **Note:** This provisioner has been deprecated as of Terraform 0.13.3 and will be
removed in a future version of Terraform. For most common situations there are better
alternatives to using provisioners. For more information, see
[the main Provisioners page](./).

## Requirements
Expand Down

0 comments on commit 81a6cde

Please sign in to comment.