似乎推薦的方法不能很好地對我工作:如何設置FQDN與ansible?
- name: Set hostname
hostname: name=mx.mydomain.net
重啓後,你可以看到我有問題FQDN,沒有在/etc/hosts
。
[email protected]:~# cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 mail mail
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
[email protected]:~# cat /etc/hostname
mx.mydomain.net
[email protected]:~# hostname
mx.mydomain.net
[email protected]:~# hostname -f
hostname: Name or service not known
似乎是鹽堆傢伙它是否正確https://github.com/saltstack-formulas/hostsfile-formula/blob/master/hostsfile/hostname.sls將從這裏複製行動 – holms 2014-09-22 18:18:40