lab-ansible/roles/vm-common/tasks/main.yml

45 lines
818 B
YAML
Raw Normal View History

2023-10-28 23:00:05 +00:00
# vim: ft=yaml.ansible
2023-10-29 19:46:52 +00:00
# code: language=ansible
2023-10-28 23:00:05 +00:00
---
2023-11-15 19:30:53 +00:00
- name: Copy hosts file
ansible.builtin.template:
src: hosts.j2
dest: /etc/hosts
owner: root
mode: u=rw,g=r,o=r
2023-10-28 23:00:05 +00:00
2023-11-15 19:30:53 +00:00
- 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
2023-10-28 23:00:05 +00:00
2023-11-15 19:30:53 +00:00
- name: Ensure services are enabled and running
ansible.builtin.service:
name: "{{ item }}"
enabled: true
state: started
loop:
- firewalld
- haveged
- lkrg
- rsyslog
2023-11-05 18:08:26 +00:00
2023-11-15 19:30:53 +00:00
- name: Configure firewall
ansible.builtin.import_tasks: firewall.yml