From a989dd2368fc0267e56ec6dd0543418a18310fe5 Mon Sep 17 00:00:00 2001 From: Leo Drachenfeuer Date: Sun, 25 Jun 2023 13:34:24 +0000 Subject: [PATCH] improve variables --- defaults/main.yml | 8 ++++++-- tasks/install.yml | 8 ++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 1d14a84..13c2bf5 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,5 +1,9 @@ --- teleport_version_check: true teleport_version: "12.2.4" -teleport_dl_url: "https://cdn.teleport.dev/teleport-v{{ teleport_version }}-linux-{{ teleport_arch }}-bin" -teleport_sha256_url: "https://get.gravitational.com/teleport-v{{ teleport_version }}-linux-{{ teleport_arch }}-bin" +teleport_base_url_tar: "https://cdn.teleport.dev" +teleport_base_url_sha: "https://get.gravitational.com" +teleport_base_filename: teleport-v{{ teleport_version }}-linux-{{ teleport_arch }}-bin +teleport_dl_url: "{{ teleport_base_url_tar }}/{{ teleport_base_filename }}.tar.gz" +teleport_sha256_url: "{{ teleport_base_url_sha }}/{{ teleport_base_filename }}.tar.gz.sha256" +pid_file_telport: "/run/teleport.pid" diff --git a/tasks/install.yml b/tasks/install.yml index ba2e9ba..9bc5cc6 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -4,9 +4,9 @@ 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" + url: "{{ teleport_dl_url }}" + dest: "/tmp/{{ teleport_base_filename }}.tar.gz" + checksum: "sha256:{{ teleport_sha256_url }}" mode: "0755" register: _download_archive until: _download_archive is succeeded @@ -24,7 +24,7 @@ - name: Unpack Teleport Package ansible.builtin.unarchive: remote_src: true - src: "/tmp/teleport-{{ teleport_version }}-linux-{{ teleport_arch }}.tar.gz" + src: "/tmp/{{ teleport_base_filename }}.tar.gz" dest: "/tmp/teleport-{{ teleport_version }}" mode: "0755" owner: "root"