canhanhan / terraform-provider-salt

Terraform provider for SaltStack OSS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

terraform-provider-salt

Terraform provider for SaltStack OSS. This provider requires CherryPy NetAPI module configured.

The intended use-case is to integrate Terraform and SaltStack:

  1. Create minion keys on master using salt_minion resource

  2. Configure and initialize Salt Minion using cloud-init.

  3. Use salt-highstate provisioner to your manifests.

  4. Terraform will create the machines, execute the provisioner and will only complete when the highstate is successfully applied.

Usage

Installation

  1. Download the binary for your platform to Terraform plugins path.

    • Windows: %AppData%\terraform.d\plugins
    • Linux: ~/.terraform.d/plugins
  2. Configure CherryPy NetAPI module on SaltStack master. See setup section of Saltstack documentation for instructions.

  3. Add the provider to your manifest. See the example manifest

Configuration

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)

Resources

salt_minion

Inputs

Name Type Usage Remarks
name String Required Minion ID
key_size Int Optional Key size (Default: 2048)

Attributes

Name Type Remarks
private_key String Minion private key
public_key String Minion public key

Example

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
}

About

Terraform provider for SaltStack OSS

License:MIT License


Languages

Language:Go 91.0%Language:HCL 9.0%