Started working with Ansible. Added some playbooks.
This commit is contained in:
14
apt_upgrade.yml
Normal file
14
apt_upgrade.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
- name: Upgrade packages
|
||||
hosts: vms
|
||||
become: true
|
||||
|
||||
tasks:
|
||||
- name: Update cache
|
||||
ansible.builtin.apt:
|
||||
update_cache: true
|
||||
register: cache_updated
|
||||
|
||||
- name: Upgrade packages if something is changed
|
||||
ansible.builtin.apt:
|
||||
upgrade: "yes"
|
||||
when: cache_updated.changed
|
||||
Reference in New Issue
Block a user