Added join_domain feature to Azure Instance resource
This commit is contained in:
parent
21d18ae2c9
commit
1a85f1344b
|
@ -170,6 +170,30 @@ func resourceAzureInstance() *schema.Resource {
|
|||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
|
||||
"domain_name": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"domain_username": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"domain_password": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
|
||||
"domain_ou": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -273,6 +297,19 @@ func resourceAzureInstanceCreate(d *schema.ResourceData, meta interface{}) (err
|
|||
if err != nil {
|
||||
return fmt.Errorf("Error configuring %s for Windows: %s", name, err)
|
||||
}
|
||||
|
||||
if domain_name, ok := d.GetOk("domain_name"); ok {
|
||||
err = vmutils.ConfigureWindowsToJoinDomain(
|
||||
&role,
|
||||
d.Get("domain_username").(string),
|
||||
d.Get("domain_password").(string),
|
||||
domain_name.(string),
|
||||
d.Get("domain_ou").(string),
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Error configuring %s for WindowsToJoinDomain: %s", name, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if s := d.Get("endpoint").(*schema.Set); s.Len() > 0 {
|
||||
|
|
Loading…
Reference in New Issue