Instance name
I need to follow a naming convention of 16 characters for my instance name ,but I want the hostname to just have first 8 characters. Is there a way I can get my server instance name and pass that as a hostname within the same template.
eg:
server_0:
type: OS::Nova::Server
properties:
name: abcdefgh
image: { get_param: image_name }
flavor: { get_param: flavor_name }
key_name: { get_param: key_name }
Within the same the template I should get the instance name and parse it using some resource type.
%hostname%: { get_attr: [ server_0 , name ] }
echo %hostname% | cut -c 1-5 > /etc/hostname
Or use cloud-init to set the hostname directly.