2023-02-16 14:15:37 +00:00
|
|
|
---
|
2023-04-25 17:54:29 +00:00
|
|
|
- name: "Update goteleport block"
|
|
|
|
when: (not teleport_version_check|bool) or (teleport_active_version.stdout != teleport_version)
|
|
|
|
block:
|
2023-02-16 14:15:37 +00:00
|
|
|
- name: Download teleport archive
|
2023-04-25 17:54:29 +00:00
|
|
|
ansible.builtin.get_url:
|
2023-06-25 13:34:24 +00:00
|
|
|
url: "{{ teleport_dl_url }}"
|
|
|
|
dest: "/tmp/{{ teleport_base_filename }}.tar.gz"
|
|
|
|
checksum: "sha256:{{ teleport_sha256_url }}"
|
2023-04-25 17:54:29 +00:00
|
|
|
mode: "0755"
|
2023-02-16 14:15:37 +00:00
|
|
|
register: _download_archive
|
|
|
|
until: _download_archive is succeeded
|
|
|
|
retries: 5
|
|
|
|
delay: 2
|
|
|
|
|
2023-04-25 17:54:29 +00:00
|
|
|
- name: Create directory if they don't exist
|
|
|
|
ansible.builtin.file:
|
2023-02-16 14:15:37 +00:00
|
|
|
path: "/tmp/teleport-{{ teleport_version }}"
|
|
|
|
state: directory
|
2023-04-25 17:54:29 +00:00
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
|
|
|
mode: "0775"
|
2023-02-16 14:15:37 +00:00
|
|
|
|
|
|
|
- name: Unpack Teleport Package
|
2023-04-25 17:54:29 +00:00
|
|
|
ansible.builtin.unarchive:
|
|
|
|
remote_src: true
|
2023-06-25 13:34:24 +00:00
|
|
|
src: "/tmp/{{ teleport_base_filename }}.tar.gz"
|
2023-02-16 14:15:37 +00:00
|
|
|
dest: "/tmp/teleport-{{ teleport_version }}"
|
2023-04-25 17:54:29 +00:00
|
|
|
mode: "0755"
|
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
2023-02-16 14:15:37 +00:00
|
|
|
|
2023-04-25 17:54:29 +00:00
|
|
|
- name: Create directory if they don't exist
|
|
|
|
ansible.builtin.file:
|
2023-02-16 14:15:37 +00:00
|
|
|
path: "/var/lib/teleport"
|
|
|
|
state: directory
|
2023-04-25 17:54:29 +00:00
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
|
|
|
mode: "0775"
|
2023-02-16 14:15:37 +00:00
|
|
|
|
2023-04-25 17:54:29 +00:00
|
|
|
- name: Copy all binaries
|
|
|
|
ansible.builtin.copy:
|
2023-02-16 14:15:37 +00:00
|
|
|
remote_src: true
|
|
|
|
src: "/tmp/teleport-{{ teleport_version }}/teleport/{{ item }}"
|
|
|
|
dest: "/usr/local/bin/{{ item }}"
|
2023-04-25 17:54:29 +00:00
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
|
|
|
mode: "0755"
|
2023-02-16 14:15:37 +00:00
|
|
|
loop:
|
|
|
|
- "tbot"
|
|
|
|
- "tctl"
|
|
|
|
- "tsh"
|
|
|
|
- "teleport"
|
2023-04-27 10:50:55 +00:00
|
|
|
notify:
|
|
|
|
- "Restart Teleport"
|
2023-02-16 14:15:37 +00:00
|
|
|
|
2023-04-27 10:54:55 +00:00
|
|
|
- name: "Clean Up Temporary Files"
|
|
|
|
ansible.builtin.file:
|
|
|
|
state: absent
|
|
|
|
path: /tmp/teleport-{{ teleport_version }}
|