jamdoog.teleport

Rol de Ansible: Teleport

Este rol desplegará Teleport en un servidor dado.

Qué hace esto:

Puedes configurar qué partes de un despliegue de teleport deseas con variables.

  • Instalar teleport a través de DEB/RPM con verificación GPG.
  • Instalar teleport desde un archivo tarball con verificación GPG (sistemas sin apt/rpm).
  • Inscribirse automáticamente como un nodo para SSH.
  • Desplegar automáticamente "comandos"/etiquetas para SSH y aplicaciones como Kernel, Teleport y más versiones.
  • Generar automáticamente un token de invitación.

Requisitos

Un sistema que utilice systemd. Esto solo se ha probado en:

Debian 10/11 RHEL 7/8/9 openSUSE 15.0/1/2/3/Tumbleweed

Cómo funciona la generación de tokens:

  • Genera un token con el comando tctl en formato JSON.
  • Extrae el token.
  • Actualiza la variable "INVITE_TOKEN".

Cómo usar la función de generación de tokens:

  • Completa las siguientes variables:

GENERATE_TOKEN: true # Requerido para que comience la generación del token. GENERATE_TOKEN_COMBO: true # Si deseas generar un token tanto para la aplicación como para el nodo. No uses esto en combinación con las variables "GENERATE_TOKEN_<....>_ONLY" a continuación. GENERATE_TOKEN_SSH_ONLY: false # Si solo deseas generar un token de nodo. GENERATE_TOKEN_APP_ONLY: false # Si solo deseas generar un token de aplicación. TELEPORT_TOKEN_HOST: "Jump" # El host (a través de SSH) donde se ejecutará tctl. TOKEN_TTL: "2m" # TTL (Tiempo de vida) del token.

Variables del rol

Variables de grupo:

Nombre Tipo Ejemplo
INVITE_TOKEN cadena 4f622402dawdawdaw
CA_PIN cadena sha256:2awdwadwad678767awd768awdd
TELEPORT_HOST cadena teleport.dominio.tld:443
TELEPORT_MAJOR_VERSION INT 10
TELEPORT_MINOR_VERSION FLOAT 3.5
GENERATE_TOKEN bool true
GENERATE_TOKEN_COMBO bool true
GENERATE_TOKEN_SSH_ONLY bool false
GENERATE_TOKEN_APP_ONLY bool false
TELEPORT_TOKEN_HOST cadena "Jump"
TOKEN_TTL cadena "10m"

Variables de host:

Nombre Tipo Ejemplo
SSH_SERVICE bool true
APP_SERVICE bool true
CREATE_SSH_COMMANDS bool true
CREATE_APP_COMMANDS bool true
CREATE_COMMAND bool true
CREATE_OS_COMMAND bool true
CREATE_KERNEL_COMMAND bool true
CREATE_TELEPORT_COMMAND bool true
CREATE_HOSTNAME_COMMAND bool true
CREATE_VIRTUALIZATION_COMMAND bool true
TELEPORT_APPLICATION_NAME cadena proxmox
TELEPORT_APPLICATION_IGNORE_TLS cadena true
TELEPORT_APPLICATION_URI cadena https://192.168.200.1:8006

Dependencias

No hay dependencias para este rol.

Ejemplo de Playbook

PLAYBOOK (TOKEN NO GENERADO):

- hosts: teleport
  become: true
  roles:
    - jamdoog.teleport
  vars:
    - INVITE_TOKEN: 4f622402dawdawdaw
    - CA_PIN: sha256:2awdwadwad678767awd768awdd
    - TELEPORT_HOST: dominio.tld:443
    - TELEPORT_MINOR_VERSION: 3.2
    - TELEPORT_MAJOR_VERSION: 10
    - SSH_SERVICE: true
    - APP_SERVICE: true
    - CREATE_COMMANDS: true 
    - CREATE_HOSTNAME_COMMAND: true 
    - CREATE_OS_COMMAND: true
    - CREATE_KERNEL_COMMAND: true
    - CREATE_TELEPORT_COMMAND: true
    - CREATE_VIRTUALIZATION_COMMAND: true
    - TELEPORT_APPLICATION_NAME: "proxmox"
    - TELEPORT_APPLICATION_IGNORE_TLS: true
    - TELEPORT_APPLICATION_URI: "https://192.168.200.1:8006"

PLAYBOOK (TOKEN GENERADO):

- hosts: teleport
  become: true
  roles:
    - jamdoog.teleport
  vars:
    - GENERATE_TOKEN: true
    - GENERATE_TOKEN_COMBO: true
    - GENERATE_TOKEN_SSH_ONLY: false
    - GENERATE_TOKEN_APP_ONLY: false
    - TELEPORT_TOKEN_HOST: "Jump"
    - TOKEN_TTL: "2m"
    - CA_PIN: sha256:2awdwadwad678767awd768awdd
    - TELEPORT_HOST: dominio.tld:443
    - TELEPORT_MINOR_VERSION: 3.2
    - TELEPORT_MAJOR_VERSION: 10
    - SSH_SERVICE: true
    - APP_SERVICE: true
    - CREATE_COMMANDS: true 
    - CREATE_HOSTNAME_COMMAND: true 
    - CREATE_OS_COMMAND: true
    - CREATE_KERNEL_COMMAND: true
    - CREATE_TELEPORT_COMMAND: true
    - CREATE_VIRTUALIZATION_COMMAND: true
    - TELEPORT_APPLICATION_NAME: "proxmox"
    - TELEPORT_APPLICATION_IGNORE_TLS: true
    - TELEPORT_APPLICATION_URI: "https://192.168.200.1:8006"

Licencia

BSD

Información del autor

Este rol fue creado por James Ledger, escribo sobre cosas en https://jamesledger.net.

Acerca del proyecto

A ansible role to automatically deploy a node as a teleport instance

Instalar
ansible-galaxy install jamdoog.teleport
Licencia
bsd-3-clause
Descargas
1.2k
Propietario