master #1

Merged
lennard.brinkhaus merged 10 commits from dragonleo/role-goteleport:master into master 2023-09-02 14:53:03 +00:00
Showing only changes of commit 4235e237e2 - Show all commits

View File

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