From a2b7b51e97b279782f97a76f21871e5e82742ce3 Mon Sep 17 00:00:00 2001 From: Hamza Date: Thu, 27 Jun 2024 17:29:11 +0200 Subject: [PATCH] allow max_hosts to be set to 0 (infinite) if enforce_default is true (#848) If max_hosts > 0 on the Controller, the user cannot set it to zero using the configuration as code. This tweak solve this issue if `controller_configuration_organizations_enforce_defaults` is set to `true`. --- roles/organizations/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/organizations/tasks/main.yml b/roles/organizations/tasks/main.yml index 3a3b9f54a..9fdc415c5 100644 --- a/roles/organizations/tasks/main.yml +++ b/roles/organizations/tasks/main.yml @@ -5,7 +5,7 @@ new_name: "{{ __controller_organizations_item.new_name | default(omit) }}" description: "{{ __controller_organizations_item.description | default(('' if controller_configuration_organizations_enforce_defaults else omit), true) }}" custom_virtualenv: "{{ __controller_organizations_item.custom_virtualenv | default(omit, true) }}" - max_hosts: "{{ __controller_organizations_item.max_hosts | default(omit, true) }}" + max_hosts: "{{ __controller_organizations_item.max_hosts | default(( 0 if controller_configuration_organizations_enforce_defaults else omit), true) }}" instance_groups: "{{ __controller_organizations_item.instance_groups | default(([] if controller_configuration_organizations_enforce_defaults else omit), true) }}" default_environment: "{{ (__controller_organizations_item.default_environment.name | default(__controller_organizations_item.default_environment | default(__controller_organizations_item.execution_environment | default(omit)))) if (assign_default_ee_to_org is defined and assign_default_ee_to_org) else omit }}" galaxy_credentials: "{{ (__controller_organizations_item.galaxy_credentials | default(([] if controller_configuration_organizations_enforce_defaults else omit), true)) if (assign_galaxy_credentials_to_org is defined and assign_galaxy_credentials_to_org) else omit }}"