61 lines
1.8 KiB
YAML
61 lines
1.8 KiB
YAML
---
|
|
- name: "Update goteleport block"
|
|
when: (not teleport_version_check|bool) or (teleport_active_version.stdout != teleport_version)
|
|
block:
|
|
- name: Download teleport archive
|
|
ansible.builtin.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"
|
|
mode: "0755"
|
|
register: _download_archive
|
|
until: _download_archive is succeeded
|
|
retries: 5
|
|
delay: 2
|
|
|
|
- name: Create directory if they don't exist
|
|
ansible.builtin.file:
|
|
path: "/tmp/teleport-{{ teleport_version }}"
|
|
state: directory
|
|
owner: "root"
|
|
group: "root"
|
|
mode: "0775"
|
|
|
|
- name: Unpack Teleport Package
|
|
ansible.builtin.unarchive:
|
|
remote_src: true
|
|
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
|
|
ansible.builtin.file:
|
|
path: "/var/lib/teleport"
|
|
state: directory
|
|
owner: "root"
|
|
group: "root"
|
|
mode: "0775"
|
|
|
|
- name: Copy all binaries
|
|
ansible.builtin.copy:
|
|
remote_src: true
|
|
src: "/tmp/teleport-{{ teleport_version }}/teleport/{{ item }}"
|
|
dest: "/usr/local/bin/{{ item }}"
|
|
owner: "root"
|
|
group: "root"
|
|
mode: "0755"
|
|
loop:
|
|
- "tbot"
|
|
- "tctl"
|
|
- "tsh"
|
|
- "teleport"
|
|
notify:
|
|
- "Restart Teleport"
|
|
|
|
- name: "Clean Up Temporary Files"
|
|
ansible.builtin.file:
|
|
state: absent
|
|
path: /tmp/teleport-{{ teleport_version }}
|