Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions roles/teleport-agent/defaults /main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
teleport_proxy: "teleport.opstree.dev:443"
token_path: "/opt/token.file"
teleport_config_path: "/etc/teleport.yaml"
content: "22f17675f040af5a9f6581f07c843e77"

5 changes: 5 additions & 0 deletions roles/teleport-agent/handlers/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- name: Restart Teleport
ansible.builtin.systemd:
name: teleport
state: restarted
4 changes: 4 additions & 0 deletions roles/teleport-agent/meta /main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
galaxy_info:
author: Pritam kondapratiwar
description: Install and configure Teleport node.
company: Opstree Solution
4 changes: 4 additions & 0 deletions roles/teleport-agent/tasks /main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: Run tasks on Teleport nodes
include_tasks: node.yml

26 changes: 26 additions & 0 deletions roles/teleport-agent/tasks /node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
- name: Create token file with teleport token
ansible.builtin.copy:
dest: "{{ token_path }}"
content: "{{ content }}"
owner: root
group: root
mode: '0600'

- name: Run teleport node install script
ansible.builtin.shell: "curl -fsSL https://{{ teleport_proxy }}/scripts/install.sh | bash"

- name: Generate /etc/teleport.yaml using teleport node configure
ansible.builtin.command: >
teleport node configure
--output={{ teleport_config_path }}
--token={{ token_path }}
--proxy={{ teleport_proxy }}

- name: Enable and start teleport service
ansible.builtin.systemd:
name: teleport
enabled: true
state: started
notify: Restart Teleport