diff --git a/configs/user-data.yaml b/configs/user-data.yaml index efcd73c..0e6f558 100644 --- a/configs/user-data.yaml +++ b/configs/user-data.yaml @@ -15,3 +15,7 @@ ssh_authorized_keys: {%- endfor %} ssh_pwauth: True + +hostname: {{ hostname }} +fqdn: {{ fqdn }} +manage_etc_hosts: True diff --git a/ubuntu_cloud.py b/ubuntu_cloud.py index 3c235b2..d41ef7d 100644 --- a/ubuntu_cloud.py +++ b/ubuntu_cloud.py @@ -28,7 +28,6 @@ def normalizeVMState(self): super(UbuntuCloud, self).normalizeVMState() self.downloadUbuntuCloudImage() self.createVmDirectory() - # TODO: write network config data out. self.writeUserData() self.writeMetaData() self.writeNetworkConfigData() @@ -175,6 +174,8 @@ def render(template_file, context): ).get_template(filename).render(context) user_data_vars = { + 'hostname': self.getVmHostName(), + 'fqdn': self.getVmName(), 'ssh_keys': self.getSshKey() }