Skip to content

cloudvps_puppet_prefix (Resource)

Manages a Cloud VPS Puppet prefix.

Example Usage

resource "cloudvps_puppet_prefix" "web" {
  name = "someproject-web-"

  roles = [
    "profile::someproject::web"
  ]

  # T398643: round-trip through built-in YAML encoder to avoid dirty diffs
  hiera = yamlencode(yamldecode(file("hiera_web.yaml")))
}

resource "cloudvps_puppet_prefix" "project" {
  # The empty prefix applies to all instances ("Project Puppet" in Horizon)
  name = ""

  # The list of roles provided should be sorted alphabetically
  roles = sort([
    "profile::locales::base",
  ])

  hiera = yamlencode({
    "puppetmaster": "someproject-puppetserver-01.someproject.eqiad1.wikimedia.cloud",
  })
}

resource "cloudvps_puppet_prefix" "web-01" {
  # Instance specific settings are manged by setting the prefix name to the
  # FQDN of the instance. This is equivalent to the "Puppet Configuration" tab
  # for an instance in Horizon.
  name = "someproject-web-01.someproject.eqiad1.wikimedia.cloud"

  hiera = yamlencode({
    "profile::someproject::web::active": true,
  })
}

Schema

Required

  • name (String) Prefix

Optional

  • hiera (String) Assigned hieradata in YAML format
  • roles (List of String) Assigned roles

Read-Only

  • id (Number) Internal prefix identifier