Files
homelab/update.yml
alecsandruchirosca ffb9ec6838 whoami
2024-05-02 21:45:19 +03:00

17 lines
333 B
YAML

- 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
update_cache: true
become: true