Skip to content

Commit dbb9846

Browse files
committed
fix(inventory): support local repo
1 parent a50815d commit dbb9846

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

services/tasks/LocalJob_inventory.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ func (t *LocalJob) tmpInventoryFilename() string {
4545
}
4646

4747
func (t *LocalJob) tmpInventoryFullPath() string {
48+
if t.Inventory.Repository.GetType() == db.RepositoryLocal {
49+
return t.Inventory.Repository.GetGitURL(true)
50+
}
4851
pathname := path.Join(util.Config.GetProjectTmpDir(t.Template.ProjectID), t.tmpInventoryFilename())
4952
if t.Inventory.Type == db.InventoryStaticYaml {
5053
pathname += ".yml"
@@ -57,6 +60,10 @@ func (t *LocalJob) cloneInventoryRepo() error {
5760
return nil
5861
}
5962

63+
if t.Inventory.Repository.GetType() == db.RepositoryLocal {
64+
return nil
65+
}
66+
6067
t.Log("cloning inventory repository")
6168

6269
repo := db_lib.GitRepository{

task_results.log

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{"hosts":[{"changed":0,"created":"0001-01-01T00:00:00Z","failed":0,"host":"host2","id":0,"ignored":0,"ok":0,"project_id":1,"rescued":0,"skipped":0,"task_id":16,"unreachable":1}],"time":"2025-06-22T07:14:19Z"}
2+
{"hosts":[{"changed":0,"created":"0001-01-01T00:00:00Z","failed":0,"host":"host2","id":0,"ignored":0,"ok":0,"project_id":1,"rescued":0,"skipped":0,"task_id":17,"unreachable":1}],"time":"2025-06-22T07:15:29Z"}
3+
{"hosts":[{"changed":0,"created":"0001-01-01T00:00:00Z","failed":0,"host":"host1","id":0,"ignored":0,"ok":0,"project_id":1,"rescued":0,"skipped":0,"task_id":18,"unreachable":1}],"time":"2025-06-22T07:17:04Z"}
4+
{"hosts":[{"changed":0,"created":"0001-01-01T00:00:00Z","failed":0,"host":"host1","id":0,"ignored":0,"ok":0,"project_id":1,"rescued":0,"skipped":0,"task_id":19,"unreachable":1}],"time":"2025-06-22T07:17:15Z"}
5+
{"hosts":[{"changed":0,"created":"0001-01-01T00:00:00Z","failed":0,"host":"host1","id":0,"ignored":0,"ok":0,"project_id":1,"rescued":0,"skipped":0,"task_id":20,"unreachable":1}],"time":"2025-06-22T07:20:00Z"}
6+
{"hosts":[{"changed":0,"created":"0001-01-01T00:00:00Z","failed":1,"host":"host1","id":0,"ignored":0,"ok":0,"project_id":1,"rescued":0,"skipped":0,"task_id":21,"unreachable":0}],"time":"2025-06-22T07:22:02Z"}
7+
{"hosts":[{"changed":0,"created":"0001-01-01T00:00:00Z","failed":0,"host":"host1","id":0,"ignored":0,"ok":0,"project_id":1,"rescued":0,"skipped":0,"task_id":22,"unreachable":1}],"time":"2025-06-22T07:23:01Z"}
8+
{"hosts":[{"changed":0,"created":"0001-01-01T00:00:00Z","failed":0,"host":"host1","id":0,"ignored":0,"ok":0,"project_id":1,"rescued":0,"skipped":0,"task_id":23,"unreachable":1}],"time":"2025-06-22T07:24:56Z"}
9+
{"hosts":[{"changed":0,"created":"0001-01-01T00:00:00Z","failed":0,"host":"host1","id":0,"ignored":0,"ok":0,"project_id":1,"rescued":0,"skipped":0,"task_id":24,"unreachable":1}],"time":"2025-06-22T07:29:04Z"}
10+
{"hosts":[{"changed":0,"created":"0001-01-01T00:00:00Z","failed":0,"host":"host1","id":0,"ignored":0,"ok":0,"project_id":1,"rescued":0,"skipped":0,"task_id":25,"unreachable":1}],"time":"2025-06-22T07:29:54Z"}
11+
{"hosts":null,"time":"2025-06-22T09:13:17Z"}
12+
{"hosts":null,"time":"2025-06-22T09:14:23Z"}
13+
{"hosts":null,"time":"2025-06-22T09:15:38Z"}
14+
{"hosts":null,"time":"2025-06-22T09:17:26Z"}
15+
{"hosts":[{"changed":0,"created":"0001-01-01T00:00:00Z","failed":0,"host":"127.0.0.1","id":0,"ignored":0,"ok":2,"project_id":1,"rescued":0,"skipped":0,"task_id":34,"unreachable":0}],"time":"2025-06-22T09:18:51Z"}

0 commit comments

Comments
 (0)