56 lines
1.6 KiB
YAML
56 lines
1.6 KiB
YAML
|
---
|
||
|
- block:
|
||
|
- name: Download teleport archive
|
||
|
get_url:
|
||
|
url: "{{ teleport_dl_url }}.tar.gz"
|
||
|
dest: "/tmp/teleport-{{ teleport_version }}-linux-{{ teleport_arch }}.tar.gz"
|
||
|
checksum: "sha256:{{ teleport_sha256_url }}.tar.gz.sha256"
|
||
|
register: _download_archive
|
||
|
until: _download_archive is succeeded
|
||
|
retries: 5
|
||
|
delay: 2
|
||
|
|
||
|
- name: create directory if they don't exist
|
||
|
file:
|
||
|
path: "/tmp/teleport-{{ teleport_version }}"
|
||
|
state: directory
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0775
|
||
|
|
||
|
- name: Unpack Teleport Package
|
||
|
unarchive:
|
||
|
remote_src: yes
|
||
|
src: "/tmp/teleport-{{ teleport_version }}-linux-{{ teleport_arch }}.tar.gz"
|
||
|
dest: "/tmp/teleport-{{ teleport_version }}"
|
||
|
mode: 0755
|
||
|
owner: root
|
||
|
group: root
|
||
|
|
||
|
- name: create directory if they don't exist
|
||
|
file:
|
||
|
path: "/var/lib/teleport"
|
||
|
state: directory
|
||
|
owner: root
|
||
|
group: root
|
||
|
mode: 0775
|
||
|
|
||
|
- name: copy all binaries
|
||
|
copy:
|
||
|
remote_src: true
|
||
|
src: "/tmp/teleport-{{ teleport_version }}/teleport/{{ item }}"
|
||
|
dest: "/usr/local/bin/{{ item }}"
|
||
|
loop:
|
||
|
- "tbot"
|
||
|
- "tctl"
|
||
|
- "tsh"
|
||
|
- "teleport"
|
||
|
|
||
|
- name: copy teleport binary
|
||
|
copy:
|
||
|
remote_src: true
|
||
|
src: "/tmp/teleport-{{ teleport_version }}/teleport/teleport"
|
||
|
dest: "/usr/local/bin/teleport"
|
||
|
notify: "Restart Teleport"
|
||
|
when: (not teleport_version_check|bool) or (teleport_active_version.stdout != teleport_version)
|