[ansible-projects] Hostname trimming help

11 views
Skip to first unread message

Prady A

unread,
Aug 2, 2023, 9:57:01 PM8/2/23
to ansible...@googlegroups.com
Hi Experts,

Not exactly an ansible issue but any thought would be greatly appreciated.
We use AD for Password synchronization between different kinds of systems. For password synchronization we also use mainframe system which accepts only 8 charters as a hostname.
So now we are trimming the hostname and sending it to the mainframe system. 
Ex: domain: ansible_hostname[:3] }}{{ ansible_hostname[-5:] }} 
Earlier based on the datacenter the hostnames were given(EX:VANC+1001). Since the datacenter names are quite different, by trimming also there are no duplicates.
But now the hostname will be decided on the business unit so less number of combinations in hostnames.
For Ex: for BU's : abcd, abcf, abciq 
hostnames will be 
abcd10001
abcf10001
abciq10001
For above all the hostnames the above ansible will return me the same hostname. which will be duplicated in the mainframe system. 
domain: ansible_hostname[:3] }}{{ ansible_hostname[-5:] }} 
abc10001
abc10001
abc10001

Any insight would be greatly helpful.

Regards

Evan Hisey

unread,
Aug 2, 2023, 10:02:08 PM8/2/23
to ansible...@googlegroups.com
Something that was done at current job was use the last 5 digits of the mac address was a prefix for the host names. The  mac pretty much guarentees a unique name with added bonus of assisting network finding on the network when there is a connectivity issue

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAEuB3Aq14AaNqJGGcKC%3D-C0CH4dkGRC6uOsCzFe-f4YysYyKiQ%40mail.gmail.com.

Prady A

unread,
Aug 2, 2023, 10:18:10 PM8/2/23
to ansible...@googlegroups.com
Thanks for your comment.
You mean to say that instead of sending the trimmed hostname only something like 
prefix 5 digits mac add+ last 3 digits of hostname. 

Thanks again for your help

Reply all
Reply to author
Forward
0 new messages