ansible-install-server/roles/fai/tasks/main.yml

131 lines
2.3 KiB
YAML

---
# tasks file for fai
- name: "Fail if 'dhcp_interface' is undefined"
ansible.builtin.fail:
msg: |
Please specify the NIC serving FAI
in variable 'dhcp_interface' (e.g. eth1)
when:
- not dhcp_interface is defined
- name: "Check packages"
package_facts:
manager: auto
- name: "Debug host_vars"
ansible.builtin.debug:
var: hostvars
verbosity: 1
tags:
- debug_hostvars
- name: "Configure operating system"
include_tasks:
file: os.yml
apply:
tags:
- os
- ansible_nopasswd
- name: "Configure networking"
include_tasks:
file: network.yml
apply:
tags:
- network
- name: "Configure package management"
include_tasks:
file: package_mgmt.yml
apply:
tags:
- package_mgmt.yml
- name: "Setup apt proxy cache"
include_tasks:
file: apt-cacher-ng.yml
apply:
tags:
- apt-cacher-ng.yml
- name: "Configure a time server"
include_tasks:
file: time-server.yml
apply:
tags:
- time-server.yml
- name: "Configure the web server"
include_tasks:
file: nginx.yml
apply:
tags:
- nginx
- name: "Configure the tftp server"
include_tasks:
file: tftpd-hpa.yml
apply:
tags:
- tftpd-hpa.yml
- name: "Configure dns server"
include_tasks:
file: unbound.yml
apply:
tags:
- unbound
- name: "Configure dhcp"
include_tasks:
file: isc-dhcp-server.yml
apply:
tags:
- dhcp
### RUN ALL SO FAR NOTIFIED HANDLERS NOW
- name: "######## Flush handlers ########"
ansible.builtin.meta: flush_handlers
- name: "Prepare FAI"
include_tasks:
file: fai-prepare.yml
apply:
tags:
- fai_prepare
- name: "Configure FAI"
include_tasks:
file: fai-configure.yml
apply:
tags:
- fai_configure
- name: "Transfer FAI profiles"
include_tasks:
file: fai-profiles.yml
apply:
tags:
- fai_profiles
- name: "Create FAI nfsroot"
include_tasks:
file: fai-nfsroot.yml
apply:
tags:
- fai_nfsroot
- name: "Configure FAI PXE"
include_tasks:
file: fai-pxe.yml
apply:
tags:
- fai_pxe
- name: "Configure FAI iPXE"
include_tasks:
file: fai-ipxe.yml
apply:
tags:
- fai_ipxe