From 67cf315de9d5b1183ad507151506cf2165f16c9c Mon Sep 17 00:00:00 2001 From: Jean-Sebastien Landry Date: Tue, 27 Feb 2024 12:28:36 -0500 Subject: [PATCH 1/2] remove 'when is defined' in main.yml remove conditions 'when is defined' for cobbler_distros, cobbler_profiles and cobbler_systems, to avoid silent failure. You have to define 'cobbler_systems: []' to maintain the same behavior, but if, for any reason, you have an error in cobbler_distros or cobbler_profiles, the task will not fail silently. --- tasks/main.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 44557ed..a9df794 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -71,14 +71,11 @@ - name: Configure distros ansible.builtin.include_tasks: file: "distros.yml" - when: cobbler_distros is defined - name: Configure profiles ansible.builtin.include_tasks: file: "profiles.yml" - when: cobbler_profiles is defined - name: Configure systems ansible.builtin.include_tasks: file: "systems.yml" - when: cobbler_systems is defined From b4d35bcac0bb9b31fc197cef20415b6666283304 Mon Sep 17 00:00:00 2001 From: Jean-Sebastien Landry Date: Thu, 29 Feb 2024 12:14:59 -0500 Subject: [PATCH 2/2] update defaults/main.yml set this vars empty as default. (to avoid a breaking change caused by deleting "when is defined") cobbler_distros: [] cobbler_profiles: [] cobbler_systems: [] --- defaults/main.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 3b7f83f..39b40e4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -53,6 +53,7 @@ cobbler_autoinstall_templates: [] cobbler_settings: # Cobbler distros (OS) +cobbler_distros: [] # cobbler_distros: # - name: distro_name # netboot: # Information about netboot files initrd and kernel @@ -66,6 +67,7 @@ cobbler_settings: # kernel: /var/lib/tftpboot/debian/11.2/debian-installer/amd64/linux # Cobbler profiles +cobbler_profiles: [] # cobbler_profiles: # - name: profile_name # properties: # Dict of Cobbler properties, as defined in the plugin cobbler_profile @@ -76,6 +78,9 @@ cobbler_settings: # content: | # any content to put in $SNIPPET('partition') +# Cobbler systems +cobbler_systems: [] + ## Dnsmasq # To use Dnsmasq as DHCP and DNS servers managed by Cobbler, enable this # module.