Skip to content

Commit

Permalink
Merge pull request #307 from ComputeCanada/cloud_facts
Browse files Browse the repository at this point in the history
Move cloud facts in user-data (puppet.yaml)
  • Loading branch information
cmd-ntrf authored May 13, 2024
2 parents 5d13213 + 16ecd23 commit ce307a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 1 addition & 4 deletions common/configuration/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,14 @@ locals {

terraform_facts = yamlencode({
software_stack = var.software_stack,
cloud = {
provider = var.cloud_provider
region = var.cloud_region
}
})

user_data = {
for key, values in var.inventory : key =>
templatefile("${path.module}/puppet.yaml",
{
cloud_provider = var.cloud_provider
cloud_region = var.cloud_region
tags = values.tags
node_name = key,
node_prefix = values.prefix,
Expand Down
8 changes: 5 additions & 3 deletions common/configuration/puppet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,15 @@ write_files:
%{ if cloud_provider != "gcp" } "GCE", %{ endif }
],
}
path: /etc/puppetlabs/facter/facter.conf
permissions: "0644"
- path: /etc/puppetlabs/facter/facts.d/prefix.yaml
content: |
- content: |
---
prefix : "${node_prefix}"
cloud:
provider: "${cloud_provider}"
region: "${cloud_region}"
path: /etc/puppetlabs/facter/facts.d/prefix.yaml
permissions: "0644"
%{ if contains(tags, "puppet") ~}
- content: |
Expand Down

0 comments on commit ce307a1

Please sign in to comment.