diff --git a/backend/windmill-worker/src/ansible_executor.rs b/backend/windmill-worker/src/ansible_executor.rs index 785d1fc868..a0aa683cb3 100644 --- a/backend/windmill-worker/src/ansible_executor.rs +++ b/backend/windmill-worker/src/ansible_executor.rs @@ -858,18 +858,16 @@ pub async fn handle_ansible_job( let mut nsjail_extra_mounts = vec![]; if let Some(r) = reqs.as_ref() { - if let Some(db) = conn.as_sql() { - nsjail_extra_mounts = create_file_resources( - &job.id, - &job.workspace_id, - job_dir, - interpolated_args.as_ref(), - &r, - &client, - db, - ) - .await?; - } + nsjail_extra_mounts = create_file_resources( + &job.id, + &job.workspace_id, + job_dir, + interpolated_args.as_ref(), + &r, + &client, + conn, + ) + .await?; for repo in &r.git_repos { append_logs( @@ -935,8 +933,7 @@ pub async fn handle_ansible_job( if let Some(collections) = r.roles_and_collections.as_ref() { let empty = String::new(); - let (lockfile, logs) = - req_lockfiles + let (lockfile, logs) = req_lockfiles .as_ref() .map(|r| (&r.collections_and_roles, &r.collections_and_roles_logs)) .unwrap_or((collections, &empty)); @@ -1162,7 +1159,7 @@ async fn create_file_resources( args: Option<&HashMap>>, r: &AnsibleRequirements, client: &crate::AuthedClient, - db: &sqlx::Pool, + conn: &Connection, ) -> error::Result> { let mut logs = String::new(); let mut nsjail_mounts: Vec = vec![]; @@ -1232,7 +1229,7 @@ async fn create_file_resources( file_res.target_path, file_res.resource_path )); } - append_logs(job_id, w_id, logs, &Connection::Sql(db.clone())).await; + append_logs(job_id, w_id, logs, conn).await; Ok(nsjail_mounts) }