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
|
|
|
---
|
|
|
|
- name: Set hostname
|
|
|
|
ansible.builtin.hostname:
|
|
|
|
name: "{{ hostname }}"
|
|
|
|
|
|
|
|
- name: Set timezone
|
|
|
|
community.general.timezone:
|
|
|
|
name: "{{ timezone }}"
|
|
|
|
|
2023-11-05 18:27:30 +00:00
|
|
|
- name: Copy hosts file
|
|
|
|
ansible.builtin.template:
|
|
|
|
src: etc/hosts.j2
|
|
|
|
dest: /etc/hosts
|
|
|
|
owner: root
|
|
|
|
mode: u=rw,g=r,o=r
|
|
|
|
|
2023-10-28 23:00:05 +00:00
|
|
|
- name: Disable systemd-resolved stub resolver
|
2023-11-07 21:25:43 +00:00
|
|
|
when: hostname in groups['control_infra']
|
|
|
|
block:
|
|
|
|
- name: Set /etc/resolv.conf symlink
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: /etc/resolv.conf
|
|
|
|
src: /run/systemd/resolve/resolv.conf
|
|
|
|
owner: root
|
|
|
|
force: true
|
|
|
|
state: link
|
|
|
|
|
2023-11-08 21:30:41 +00:00
|
|
|
- name: Set DNSStubListener=no
|
2023-11-07 21:25:43 +00:00
|
|
|
ansible.builtin.lineinfile:
|
|
|
|
path: /etc/systemd/resolved.conf
|
|
|
|
regexp: '^#?DNSStubListener='
|
|
|
|
line: 'DNSStubListener=no'
|
|
|
|
state: present
|
|
|
|
notify: Restart systemd-resolved
|
2023-10-28 23:00:05 +00:00
|
|
|
|
2023-11-12 18:39:49 +00:00
|
|
|
- name: Enable extra repositories
|
2023-11-12 15:41:59 +00:00
|
|
|
ansible.builtin.dnf:
|
2023-11-12 18:39:49 +00:00
|
|
|
name:
|
|
|
|
- epel-release
|
|
|
|
- rocky-release-security
|
2023-11-12 15:41:59 +00:00
|
|
|
state: present
|
2023-11-11 18:11:14 +00:00
|
|
|
|
|
|
|
- name: Install system packages
|
2023-11-12 15:41:59 +00:00
|
|
|
ansible.builtin.dnf:
|
|
|
|
name:
|
2023-11-11 18:11:14 +00:00
|
|
|
- firewalld
|
2023-11-12 18:39:49 +00:00
|
|
|
- haveged
|
|
|
|
- htop
|
|
|
|
- jq
|
2023-11-12 15:41:59 +00:00
|
|
|
- lkrg
|
2023-11-12 18:39:49 +00:00
|
|
|
- logrotate
|
|
|
|
- mtr
|
|
|
|
- rsyslog
|
|
|
|
update_cache: true
|
2023-11-12 15:41:59 +00:00
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: Ensure services are enabled and running
|
|
|
|
ansible.builtin.service:
|
|
|
|
name: "{{ item }}"
|
|
|
|
enabled: true
|
|
|
|
state: started
|
|
|
|
loop:
|
|
|
|
- firewalld
|
2023-11-12 18:39:49 +00:00
|
|
|
- haveged
|
2023-11-12 15:41:59 +00:00
|
|
|
- lkrg
|
2023-11-12 18:39:49 +00:00
|
|
|
- rsyslog
|