From 29568f5a059b63077668dbc80eb0930a74140c29 Mon Sep 17 00:00:00 2001 From: Tobias Stein Date: Sat, 10 Dec 2022 20:09:47 +0100 Subject: [PATCH] Add support for tags --- roles/fai/tasks/main.yml | 137 +++++++++++++++++---------------------- 1 file changed, 59 insertions(+), 78 deletions(-) diff --git a/roles/fai/tasks/main.yml b/roles/fai/tasks/main.yml index 0f8db12..5dd3748 100644 --- a/roles/fai/tasks/main.yml +++ b/roles/fai/tasks/main.yml @@ -20,111 +20,92 @@ - debug_hostvars - name: "Configure operating system" - include_tasks: - file: os.yml - apply: - tags: - - os - - ansible_nopasswd + import_tasks: os.yml + tags: + - os + - ansible_nopasswd - name: "Configure networking" - include_tasks: - file: network.yml - apply: - tags: - - network + import_tasks: network.yml + tags: + - network - name: "Configure package management" - include_tasks: - file: package_mgmt.yml - apply: - tags: - - package_mgmt.yml + import_tasks: package_mgmt.yml + tags: + - package_mgmt + +- name: "Configure zsh" + import_tasks: zsh.yml + tags: + - zsh - name: "Setup apt proxy cache" - include_tasks: - file: apt-cacher-ng.yml - apply: - tags: - - apt-cacher-ng.yml + import_tasks: apt-cacher-ng.yml + tags: + - apt-cacher-ng - name: "Configure a time server" - include_tasks: - file: time-server.yml - apply: - tags: - - time-server.yml + import_tasks: time-server.yml + tags: + - time-server - name: "Configure the web server" - include_tasks: - file: nginx.yml - apply: - tags: - - nginx + import_tasks: nginx.yml + tags: + - nginx - name: "Configure the tftp server" - include_tasks: - file: tftpd-hpa.yml - apply: - tags: - - tftpd-hpa.yml + import_tasks: tftpd-hpa.yml + tags: + - tftpd-hpa - name: "Configure dns server" - include_tasks: - file: unbound.yml - apply: - tags: - - unbound + import_tasks: unbound.yml + tags: + - unbound - name: "Configure dhcp" - include_tasks: - file: isc-dhcp-server.yml - apply: - tags: - - dhcp + import_tasks: isc-dhcp-server.yml + tags: + - dhcp + - isc-dhcp-server ### 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 + import_tasks: fai-prepare.yml + tags: + - fai_prepare -- name: "Configure FAI" - include_tasks: - file: fai-configure.yml - apply: - tags: - - fai_configure +- name: "Configure '{{ fai_dir_etc }}'" + import_tasks: fai-etc-dir.yml + tags: + - fai_etc_dir + - fai_nfsroot -- name: "Transfer FAI profiles" - include_tasks: - file: fai-profiles.yml - apply: - tags: - - fai_profiles +- name: "Configure '{{ fai_dir_config }}'" + import_tasks: fai-config-dir.yml + tags: + - fai_config_dir + +### RUN ALL SO FAR NOTIFIED HANDLERS NOW +- name: "######## Flush handlers ########" + ansible.builtin.meta: flush_handlers - name: "Create FAI nfsroot" - include_tasks: - file: fai-nfsroot.yml - apply: - tags: - - fai_nfsroot + import_tasks: fai-nfsroot.yml + tags: + - fai_nfsroot - name: "Configure FAI PXE" - include_tasks: - file: fai-pxe.yml - apply: - tags: - - fai_pxe + import_tasks: fai-pxe.yml + tags: + - fai_pxe - name: "Configure FAI iPXE" - include_tasks: - file: fai-ipxe.yml - apply: - tags: - - fai_ipxe + import_tasks: fai-ipxe.yml + tags: + - fai_ipxe