1
0
mirror of https://git.libreschool.org/paspo/brasatore.git synced 2024-11-21 21:58:44 +00:00
brasatore/roles/pxeserver/tasks/common.yml
2023-10-27 12:34:26 +02:00

85 lines
1.5 KiB
YAML

---
- name: Set up multiple authorized keys
authorized_key:
user: root
state: present
key: "{{ ssh_key }}"
- name: Set hostname
template:
src: etc_hostname
dest: /etc/hostname
owner: root
group: root
mode: "0644"
become: true
- name: Set hostname (hosts file)
template:
src: etc_hosts
dest: /etc/hosts
owner: root
group: root
mode: "0644"
become: true
notify: reboot
- name: Updating package cache
apt:
update_cache: yes
cache_valid_time: 3600
become: true
ignore_errors: true
- name: Installing common packages
apt:
name:
[
"htop",
"screen",
"ntpdate",
"ntp",
"unattended-upgrades",
"dnsmasq",
"nginx",
"iptables",
"ipxe",
"syslinux-common",
"unzip",
"nfs-kernel-server",
"iptables-persistent"
]
state: latest
become: true
ignore_errors: true
- name: Upgrade all packages to the latest version
apt:
name: "*"
state: latest
become: true
ignore_errors: true
- name: Configure NTP
ini_file:
path: /etc/systemd/timesyncd.conf
section: Time
option: NTP
value: pool.ntp.org
become: true
- name: sets the timezone
timezone:
name: "Europe/Rome"
become: true
- name: Create storage directories
ansible.builtin.file:
path: "{{ item }}"
state: directory
mode: "0755"
with_items:
- /srv/pxe/iso
- /srv/pxe/mount
- /srv/tftp