Back to Teleport

Automated node join script for Teleport

lib/web/scripts/node-join/README.md

19.0.1-dev2.7 KB
Original Source

Automated node join script for Teleport

This is an automated node join script for Teleport, which does the following:

  • checks for an existing Teleport process, data directory, config file or Teleport binaries (and provides details how to clean up if any of these are present)
  • tests connectivity to the given Teleport server host and port
    • using either nc, telnet or /dev/tcp if available - if none of these are available this step is skipped
  • detects OS, distribution, architecture and appropriate Teleport package format, then downloads this package to a temporary directory and installs it
    • tar for tarball extraction if needed
    • dpkg for .deb installs
    • dnf, yum or rpm for .rpm installs
  • generates a Teleport config to set up a node and writes it to disk
  • installs and starts Teleport
    • via systemd on Linux
    • via launchctl on MacOS
  • cleans up downloaded archives afterwards

Things it doesn't do (yet):

  • validate the checksum of the downloaded Teleport artifact against the published checksum

Supported operating systems, architectures and distributions

  • Linux

    • Architectures
      • i386
      • x86_64
      • armv7l
      • aarch64 (no Teleport binaries available yet)
    • Any Debian-based distribution
      • Debian 8+
      • Ubuntu 18.04+
        • uses .deb package
    • Any CentOS-based distribution
      • CentOS 6+*
      • RHEL 6+*
        • CentOS 6 and RHEL 6 will use the special centos6 tarball package to handle the lower glibc version.
      • Fedora 27+
      • Amazon Linux 2+
        • uses .rpm package
    • Any other distribution
      • uses .tar.gz tarball package
  • macOS

    • Architectures
      • x86_64
      • aarch64
    • macOS 12.0+
      • uses .tar.gz tarball package

Arguments

Required arguments:

FlagDescriptionExample valueRequired
-vTeleport version4.3.5yes
-hHostname for the Teleport Proxy Serviceteleport.example.comyes
-jA valid node join tokenool7ahpo4thohmeuS1gieY7laiwae7ooyes
-cThe CA pin hash of the cluster being joinedsha256:6abdd3a143a230fd31c9706d668bba3ee25a6e0eec54fcd69680c1ec0530fe9cyes
-pPort connect to on the Teleport Proxy Service3080no

If any of these arguments is not provided via CLI flags, they will be requested interactively at runtime.

Optional extra flags:

FlagDescriptionExample valueRequired
-qEnable quiet moden/ano
-lWrite logs to file/var/log/teleport-node-installer.logno

Example usage

console
$ bash ./install.sh \
    -j ool7ahpo4thohmeuS1gieY7laiwae7oo \
    -c sha256:6abdd3a143a230fd31c9706d668bba3ee25a6e0eec54fcd69680c1ec0530fe9c \
    -h teleport.example.com \
    -p 3080 \
    -v 4.3.5