Skip to content

Commit 285bb45

Browse files
authored
feat: add allow_override for awx_project. (#30)
1 parent 2276033 commit 285bb45

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

awx/resource_project.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ func resourceProject() *schema.Resource {
108108
Optional: true,
109109
Default: 0,
110110
},
111+
"allow_override": {
112+
Type: schema.TypeBool,
113+
Optional: true,
114+
Default: false,
115+
Description: "Allow SCM branch override"
116+
}
111117
},
112118
Importer: &schema.ResourceImporter{
113119
State: schema.ImportStatePassthrough,
@@ -156,6 +162,7 @@ func resourceProjectCreate(ctx context.Context, d *schema.ResourceData, m interf
156162

157163
"scm_update_on_launch": d.Get("scm_update_on_launch").(bool),
158164
"scm_update_cache_timeout": d.Get("scm_update_cache_timeout").(int),
165+
"allow_override": d.Get("allow_override").(bool),
159166
}, map[string]string{})
160167
if err != nil {
161168
return buildDiagnosticsMessage("Create: Project not created", "Project with name %s in the Organization ID %v not created, %s", projectName, orgID, err.Error())
@@ -190,6 +197,7 @@ func resourceProjectUpdate(ctx context.Context, d *schema.ResourceData, m interf
190197
"organization": d.Get("organization_id").(int),
191198
"scm_update_on_launch": d.Get("scm_update_on_launch").(bool),
192199
"scm_update_cache_timeout": d.Get("scm_update_cache_timeout").(int),
200+
"allow_override": d.Get("allow_override").(bool),
193201
}
194202

195203
// Cannot change local_path for git-based projects
@@ -285,6 +293,7 @@ func setProjectResourceData(d *schema.ResourceData, r *awx.Project) *schema.Reso
285293
}
286294
d.Set("scm_update_on_launch", r.ScmUpdateOnLaunch)
287295
d.Set("scm_update_cache_timeout", r.ScmUpdateCacheTimeout)
296+
d.Set("allow_override".r.AllowOverride)
288297

289298
d.SetId(strconv.Itoa(r.ID))
290299
return d

0 commit comments

Comments
 (0)