diff --git a/changelogs/fragments/keycloak-authentication-none-executions.yml b/changelogs/fragments/keycloak-authentication-none-executions.yml new file mode 100644 index 0000000000..ca089346fc --- /dev/null +++ b/changelogs/fragments/keycloak-authentication-none-executions.yml @@ -0,0 +1,5 @@ +bugfixes: + - keycloak_authentication - fix ``TypeError`` crash when a flow is defined without + ``authenticationExecutions`` + (https://github.com/ansible-collections/community.general/issues/11547, + https://github.com/ansible-collections/community.general/pull/11548). diff --git a/plugins/modules/keycloak_authentication.py b/plugins/modules/keycloak_authentication.py index 1678f46f85..0c4fba36d5 100644 --- a/plugins/modules/keycloak_authentication.py +++ b/plugins/modules/keycloak_authentication.py @@ -273,7 +273,7 @@ def create_or_update_executions(kc, config, realm="master"): after = "" before = "" execution = None - if "authenticationExecutions" in config: + if config.get("authenticationExecutions") is not None: # Get existing executions on the Keycloak server for this alias existing_executions = kc.get_executions_representation(config, realm=realm) for new_exec_index, new_exec in enumerate(config["authenticationExecutions"], start=0):