You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
492 B
24 lines
492 B
- hosts: all
|
|
tasks:
|
|
- name: get user
|
|
become: true
|
|
become_method: sudo
|
|
become_user: root
|
|
# uses_shell: true
|
|
ansible.builtin.shell: whoami
|
|
|
|
|
|
# - 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
|
|
|