mirror of
https://github.com/puppetlabs/vmpooler-provider-gce.git
synced 2026-01-26 03:18:41 -05:00
Set hostname for instance during create_vm
This sets the instance hostname to the configured domain according to https://cloud.google.com/compute/docs/instances/custom-hostname-vm#api and https://googleapis.dev/ruby/google-api-client/latest/Google/Apis/ComputeV1/Instance.html#hostname-instance_method
This commit is contained in:
parent
614c474305
commit
b62580df0a
1 changed files with 4 additions and 0 deletions
|
|
@ -191,9 +191,13 @@ module Vmpooler
|
|||
boot: true,
|
||||
initialize_params: Google::Apis::ComputeV1::AttachedDiskInitializeParams.new(init_params)
|
||||
)
|
||||
append_domain = domain || global_config[:config]['domain']
|
||||
fqdn = "#{new_vmname}.#{append_domain}" if append_domain
|
||||
|
||||
# Assume all pool config is valid i.e. not missing
|
||||
client = ::Google::Apis::ComputeV1::Instance.new(
|
||||
name: new_vmname,
|
||||
hostname: fqdn,
|
||||
machine_type: pool['machine_type'],
|
||||
disks: [disk],
|
||||
network_interfaces: [network_interfaces],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue