Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

kandra: Use to_yaml when writing YAML data.

Alex Vandiver1635fa580181
diff --git a/puppet/kandra/manifests/teleport/application.pp b/puppet/kandra/manifests/teleport/application.pp
index 0b7f75b9b19..ceebf2d7d69 100644
--- a/puppet/kandra/manifests/teleport/application.pp
+++ b/puppet/kandra/manifests/teleport/application.pp
@@ -7,9 +7,23 @@ define kandra::teleport::application (
$order = '50',
) {
include kandra::teleport::application_top
+ $app_data = [
+ {
+ name => $name,
+ description => $description,
+ uri => "http://127.0.0.1:${port}",
+ labels => {
+ name => $name,
+ },
+ },
+ ]
+
+ # This is appended to puppet/kandra/files/teleport_node.yaml, so
+ # must be indented, and the leading document dashes stripped.
+ $app_yaml = to_yaml($app_data).regsubst(/\A---\s*\n/, '').regsubst(/^/, ' ', 'G')
concat::fragment { "teleport_app_${name}":
target => '/etc/teleport_node.yaml',
order => $order,
- content => template('kandra/teleport_app.yaml.template.erb'),
+ content => $app_yaml,
}
}
diff --git a/puppet/kandra/templates/teleport_app.yaml.template.erb b/puppet/kandra/templates/teleport_app.yaml.template.erb
deleted file mode 100644
index 8cb3b3079a5..00000000000
--- a/puppet/kandra/templates/teleport_app.yaml.template.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-<%# This is appended to puppet/kandra/files/teleport_node.yaml, so should be
- indented. Specifically, the "-" should be in the same column as the "T" at
- the start of this comment. -%>
- - name: "<%= @name %>"
- description: "<%= @description %>"
- uri: "http://127.0.0.1:<%= @port %>"
- labels:
- name: "<%= @name %>"