Some changes in Ansible configuration
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1 +1,3 @@
|
|||||||
.vscode/
|
.vscode/
|
||||||
|
Ansible/secrets.yml
|
||||||
|
Ansible/inventory/hosts.ini
|
||||||
@@ -3,12 +3,22 @@
|
|||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Update cache
|
- name: Update apt cache
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
update_cache: true
|
update_cache: true
|
||||||
register: cache_updated
|
register: cache_updated
|
||||||
|
|
||||||
- name: Upgrade packages if something is changed
|
- name: Upgrade all packages
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
upgrade: "yes"
|
upgrade: "yes"
|
||||||
when: cache_updated.changed
|
when: cache_updated.changed or cache_updated.rc == 0
|
||||||
|
|
||||||
|
- name: Autoremove unnecessary packages
|
||||||
|
ansible.builtin.apt:
|
||||||
|
autoremove: true
|
||||||
|
when: cache_updated.changed or cache_updated.rc == 0
|
||||||
|
|
||||||
|
- name: Autoclean apt cache
|
||||||
|
ansible.builtin.apt:
|
||||||
|
autoclean: true
|
||||||
|
when: cache_updated.changed or cache_updated.rc == 0
|
||||||
0
Ansible/hosts.ini
Normal file
0
Ansible/hosts.ini
Normal file
Reference in New Issue
Block a user