diff --git a/osism/commands/apply.py b/osism/commands/apply.py index c99c59e7..ffeaae87 100644 --- a/osism/commands/apply.py +++ b/osism/commands/apply.py @@ -228,11 +228,18 @@ def handle_role( if overwrite: environment = overwrite - logger.info( - f"An attempt is made to execute a role that is provided in the configuration repository. " - f"If there is no further output following this output, the role {role} in the environment" - f" {environment} was not found." - ) + if environment in ["custom"] or role not in MAP_ROLE2ENVIRONMENT: + task_timeout = 60 + timeout = 60 + + logger.info( + "An attempt is made to execute a role that is provided in the " + "configuration repository. If there is no further output " + f"following this output, the role {role} in the environment " + f"{environment} was not found. The timeout is explicitly " + f"set to {timeout} seconds." + ) + t = ansible.run.delay( environment, role, arguments, auto_release_time=task_timeout ) diff --git a/releasenotes/notes/custom-plays-timeout-9fd5f0452a11aae5.yaml b/releasenotes/notes/custom-plays-timeout-9fd5f0452a11aae5.yaml new file mode 100644 index 00000000..b6a9cad4 --- /dev/null +++ b/releasenotes/notes/custom-plays-timeout-9fd5f0452a11aae5.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Timeout on custom plays explicitly set to 60 seconds.