Packer.Images/ansible/roles/os/tasks/packages.yml

29 lines
690 B
YAML
Raw Normal View History

2022-10-10 13:01:03 +00:00
- name: Configure 'needrestart' package
ansible.builtin.lineinfile:
path: /etc/needrestart/needrestart.conf
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
loop:
- regexp: "^#\\$nrconf\\{restart\\} = 'i';"
line: "$nrconf{restart} = 'a';"
- regexp: "^#\\$nrconf\\{kernelhints\\} = -1;"
line: "$nrconf{kernelhints} = -1;"
2021-06-08 19:27:08 +00:00
- name: Install additional packages
ansible.builtin.apt:
name: "{{ item }}"
state: latest
update_cache: yes
2021-06-08 19:27:59 +00:00
loop: "{{ packages }}"
2022-10-10 13:01:03 +00:00
2021-06-08 19:56:06 +00:00
- name: Upgrade all packages
ansible.builtin.apt:
name: "*"
state: latest
update_cache: yes
2022-10-10 13:01:03 +00:00
2021-06-08 19:56:06 +00:00
- name: Cleanup
ansible.builtin.apt:
autoremove: yes
2021-06-11 12:44:43 +00:00
purge: yes