Update EC2 instances hostnames to their EC2 instance tags

13 views
Skip to first unread message

Leo

unread,
Jun 22, 2020, 5:43:14 PM6/22/20
to Ansible Project
Hi everyone,

I have got a question about the EC2 and it related modules. I would like to update the hostnames of all of the EC2 instances created by another role within the same playbook (all EC2 instances are dynamic inventories, no host file) by using their EC2 instance tag. For example, if an instance has a tag "Name: dbserver01", I would like to update its hostname to "dbserver01.mydomain,mycompany.local". What should I do? 
Reply all
Reply to author
Forward
0 new messages