Packer.Images/ansible/roles/os/tasks/packages.yml
djpbessems a20cb4417c
Some checks failed
continuous-integration/drone/push Build is failing
Configure Ansible defaults
2022-11-29 14:32:44 +01:00

48 lines
1.1 KiB
YAML

- 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;"
loop_control:
label: "{{ item.line }}"
- name: Install additional packages
ansible.builtin.apt:
pkg: "{{ packages.apt }}"
state: latest
update_cache: yes
install_recommends: no
- name: Upgrade all packages
ansible.builtin.apt:
name: '*'
state: latest
update_cache: yes
- name: Install additional python packages
ansible.builtin.pip:
name: "{{ item }}"
executable: pip3
state: latest
loop: "{{ packages.pip }}"
- name: Create folder
ansible.builtin.file:
path: /etc/ansible
state: directory
- name: Configure Ansible defaults
ansible.builtin.template:
src: ansible.j2
dest: /etc/ansible/ansible.cfg
- name: Cleanup
ansible.builtin.apt:
autoremove: yes
purge: yes