From ffb9ec68382a4c76ed8b539f65f7af582bc46c4f Mon Sep 17 00:00:00 2001 From: alecsandruchirosca Date: Thu, 2 May 2024 21:45:19 +0300 Subject: [PATCH] whoami --- update.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/update.yml b/update.yml index a61aa43..5970cb5 100644 --- a/update.yml +++ b/update.yml @@ -1,5 +1,14 @@ - hosts: all tasks: + - name: Run whoami without become. + command: whoami + changed_when: false + become: false + register: whoami + + - name: Set a fact with the user name. + set_fact: + login_user: "{{ whoami.stdout }}" - name: Update Ubuntu apt: upgrade: true