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.
homelab/update.yml

33 lines
666 B

- hosts: all
become: true
tasks:
- name: Update and upgrade apt packages
apt:
upgrade: yes
update_cache: yes
become: yes
# - hosts: all
# become: true
# become_method: sudo
# become_user: root
# tasks:
# - name: get user
# # 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