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.

puppet: Add a teleport application server.

Alex Vandiver4f51d32676a5
diff --git a/puppet/zulip_ops/files/teleport_node.yaml b/puppet/zulip_ops/files/teleport_node.yaml
index 4343b15bd5d..dec4efdd03e 100644
--- a/puppet/zulip_ops/files/teleport_node.yaml
+++ b/puppet/zulip_ops/files/teleport_node.yaml
@@ -2,7 +2,9 @@
teleport:
ca_pin: "sha256:df15ba56d56227e288ce183d7eee77a6bef552aaaa5dc25f0f5ea56494ce14c6"
auth_servers:
- - teleport.zulipchat.net
+ # Use the proxy address, to support running the app_service, which requires
+ # a reverse tunnel.
+ - teleport.zulipchat.net:443
ssh_service:
enabled: "yes"
@@ -15,5 +17,9 @@ proxy_service:
enabled: no
auth_service:
enabled: no
+
+# We intentionally end with `app_service` so we can append services under
+# `apps:` via puppet.
app_service:
- enabled: no
+ enabled: yes
+ apps:
diff --git a/puppet/zulip_ops/manifests/teleport/application.pp b/puppet/zulip_ops/manifests/teleport/application.pp
new file mode 100644
index 00000000000..e9249decb35
--- /dev/null
+++ b/puppet/zulip_ops/manifests/teleport/application.pp
@@ -0,0 +1,13 @@
+# @summary Adds an http "application" to the Teleport configuration for the host.
+#
+# See https://goteleport.com/docs/application-access/
+define zulip_ops::teleport::application (
+ $port,
+ $order = '50',
+) {
+ concat::fragment { "teleport_app_${name}":
+ target => '/etc/teleport_node.yaml',
+ order => $order,
+ content => " - name: ${name}\n uri: http://127.0.0.1:${port}\n",
+ }
+}
diff --git a/puppet/zulip_ops/manifests/teleport/node.pp b/puppet/zulip_ops/manifests/teleport/node.pp
index 9bdd8fb3c15..1d5986e0b74 100644
--- a/puppet/zulip_ops/manifests/teleport/node.pp
+++ b/puppet/zulip_ops/manifests/teleport/node.pp
@@ -5,12 +5,16 @@
class zulip_ops::teleport::node {
include zulip_ops::teleport::base
- file { '/etc/teleport_node.yaml':
- ensure => file,
+ concat { '/etc/teleport_node.yaml':
+ ensure => present,
owner => 'root',
group => 'root',
mode => '0644',
+ }
+ concat::fragment { 'teleport_node_base':
+ target => '/etc/teleport_node.yaml',
source => 'puppet:///modules/zulip_ops/teleport_node.yaml',
+ order => '01',
}
file { "${zulip::common::supervisor_conf_dir}/teleport_node.conf":
@@ -18,7 +22,7 @@ class zulip_ops::teleport::node {
require => [
Package[supervisor],
Package[teleport],
- File['/etc/teleport_node.yaml'],
+ Concat['/etc/teleport_node.yaml'],
],
owner => 'root',
group => 'root',
@@ -26,9 +30,4 @@ class zulip_ops::teleport::node {
source => 'puppet:///modules/zulip_ops/supervisor/conf.d/teleport_node.conf',
notify => Service[$zulip::common::supervisor_service],
}
-
- # https://goteleport.com/docs/admin-guide/#ports
- # Port 3022 is inward-facing; the proxy uses it to set up outside
- # connections to this node.
- zulip_ops::firewall_allow { 'teleport_node': port => 3022 }
}