Terraform provider for SaltStack OSS. This provider requires CherryPy NetAPI module configured.
The intended use-case is to integrate Terraform and SaltStack:
-
Create minion keys on master using
salt_minion
resource -
Configure and initialize Salt Minion using cloud-init.
-
Use salt-highstate provisioner to your manifests.
-
Terraform will create the machines, execute the provisioner and will only complete when the highstate is successfully applied.
-
Download the binary for your platform to Terraform plugins path.
- Windows:
%AppData%\terraform.d\plugins
- Linux:
~/.terraform.d/plugins
- Windows:
-
Configure CherryPy NetAPI module on SaltStack master. See setup section of Saltstack documentation for instructions.
-
Add the provider to your manifest. See the example manifest
Name | Type | Required | Remarks |
---|---|---|---|
address |
String | Required | URL to the CherryPy NetAPI endpoint (e.g.: https://saltmaster:8000) |
password |
String | Required | Password |
backend |
String | Required | External authentincation backend (eauth) (e.g.: pam) |
skip_verify |
Bool | Optional | Skip TLS/SSL verification (Default: false) |
Name | Type | Usage | Remarks |
---|---|---|---|
name |
String | Required | Minion ID |
key_size |
Int | Optional | Key size (Default: 2048) |
Name | Type | Remarks |
---|---|---|
private_key |
String | Minion private key |
public_key |
String | Minion public key |
provider "salt" {
address = "http://192.168.50.10:8000"
username = "test_user"
password = "test_pwd"
backend = "pam"
}
resource "salt_minion" "test" {
name = "minion1"
key_size = 4096
}