From 8cf12cc88092751d1cf01744e0b783f2a7a530d9 Mon Sep 17 00:00:00 2001 From: Leo Drachenfeuer Date: Sun, 25 Jun 2023 13:36:44 +0000 Subject: [PATCH] add tasks for getting main pid from teleport --- tasks/main.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index f62ba75..99939eb 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -8,5 +8,20 @@ failed_when: false when: teleport_version_check|bool +- name: "Check if teleport pid file exist" + ansible.builtin.stat: + path: "{{ pid_file_telport }}" + register: pid_file_telport_state + +- name: "Get Main PID of Teleport" + when: pid_file_teleport_state.stat.isdir is defined and not pid_file_teleport_state.stat.isdir + ansible.builtin.shell: "cat /run/teleport.pid" + args: + executable: /bin/bash + register: teleport_main_pid + changed_when: false + failed_when: false + + - name: "Update goteleport" ansible.builtin.include_tasks: "install.yml"