Merge pull request #26203 from hashicorp/pselle/deprecate-vendor-provisioners

Deprecate vendor (3rd party) provisioners
This commit is contained in:
Pam Selle 2020-09-15 13:52:10 -04:00 committed by GitHub
commit 81a6cde3cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 25 additions and 8 deletions

View File

@ -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...)

View File

@ -0,0 +1,3 @@
resource "null_resource" "test" {
provisioner "habitat" {} # WARNING: The "habitat" provisioner is deprecated
}

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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