From 1de43eb8d7796d910eeeb6b612835d2c8f4f776a Mon Sep 17 00:00:00 2001 From: Adam Ruzicka Date: Fri, 29 Nov 2024 17:50:52 +0100 Subject: [PATCH] Associate more templates with CentOS Stream --- .../tasks/configure_centos_9.yml | 31 ++++++++++++++++--- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/roles/foreman_provisioning/tasks/configure_centos_9.yml b/roles/foreman_provisioning/tasks/configure_centos_9.yml index 611087920..a4ccc3d35 100644 --- a/roles/foreman_provisioning/tasks/configure_centos_9.yml +++ b/roles/foreman_provisioning/tasks/configure_centos_9.yml @@ -1,3 +1,23 @@ +- name: 'Set templates fact' + set_fact: + templates: + - kind: 'host_init_config' + name: 'Linux host_init_config default' + - kind: 'provision' + name: 'Kickstart default' + - kind: 'PXEGrub' + name: 'Kickstart default PXEGrub' + - kind: 'PXEGrub2' + name: 'Kickstart default PXEGrub2' + - kind: 'PXELinux' + name: 'Kickstart default PXELinux' + - kind: 'finish' + name: 'Kickstart default finish' + - kind: 'iPXE' + name: 'Kickstart default iPXE' + - kind: 'user_data' + name: 'Kickstart default user data' + - name: "Ensure CentOS Stream 9" # noqa: args[module] theforeman.foreman.operatingsystem: name: CentOS_Stream @@ -7,15 +27,16 @@ - x86_64 media: - CentOS Stream 9 mirror - provisioning_templates: - - Kickstart default + provisioning_templates: "{{ templates | map(attribute='name') }}" ptables: - Kickstart default state: present + password_hash: "SHA256" -- name: "Set default template for CentOS Stream 9" # noqa: args[module] +- name: "Set default templates for CentOS Stream 9" # noqa: args[module] theforeman.foreman.os_default_template: operatingsystem: "CentOS_Stream 9" - template_kind: "provision" - provisioning_template: "Kickstart default" + template_kind: "{{ item.kind }}" + provisioning_template: "{{ item.name }}" state: present + loop: "{{ templates }}"