lab-ansible/roles/vm-common/tasks/main.yml
2023-11-15 20:30:53 +01:00

45 lines
818 B
YAML

# vim: ft=yaml.ansible
# code: language=ansible
---
- name: Copy hosts file
ansible.builtin.template:
src: hosts.j2
dest: /etc/hosts
owner: root
mode: u=rw,g=r,o=r
- name: Enable extra repositories
ansible.builtin.dnf:
name:
- epel-release
- rocky-release-security
state: present
- name: Install system packages
ansible.builtin.dnf:
name:
- firewalld
- haveged
- htop
- jq
- lkrg
- logrotate
- mtr
- rsyslog
update_cache: true
state: present
- name: Ensure services are enabled and running
ansible.builtin.service:
name: "{{ item }}"
enabled: true
state: started
loop:
- firewalld
- haveged
- lkrg
- rsyslog
- name: Configure firewall
ansible.builtin.import_tasks: firewall.yml