You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

20 lines
533 B

---
- name: setup DHCP client
hosts: bind-client-group:!external-host
become: true
roles:
- role: dhclient
vars:
dns_nameservers: [ '{{ hostvars[groups["bind-service-group"][0]]["ansible_host"] }}' ]
dns_search: "{{ domain }}"
dns_domain: "{{ domain }}"
tasks:
#
# it must *not* be set before the DNS is updated otherwise
# the name resolution will fail and sudo will timeout
#
- name: set hostname
hostname:
name: '{{ inventory_hostname }}.{{ domain }}'