3

I am using salt-cloud to create new aws instances:

salt-cloud -p base_ec2_micro test.mydomain.com

However, the instance gets its ip as hostname. What can I do to set the fqdn as hostname?

Thanks

Cramix
  • 115
  • 10

1 Answers1

0

I know this question is ancient, but I'm doing this - I believe you have to use a Salt "state" file (.SLS) to apply the state after firstboot:

salt.grains.core.fqdns().

Return all known FQDNs for the system by enumerating all interfaces and then trying to reverse resolve them (excluding 'lo' interface). To disable the fqdns grain, set enable_fqdns_grains: False in the minion configuration file.

via: https://docs.saltproject.io/en/latest/ref/grains/all/salt.grains.core.html

SamAndrew81
  • 264
  • 1
  • 5
  • 20