--- - 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", "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